Looking to develop a React Native library using JavaScript instead of typescript, but want to leverage TSC for its ability to generate type declarations from jsdoc comments. However, encountering an issue where local images are not included when the ts compiler runs.
Attempted Solution#4, but unable to get images included in dist/Images
directory upon running tsc
.
+ src
+ //another folder
+ Images
- Images.js // added require('./error.png')
- error.png
- index.js
- declaration.d.ts
- package.json
- tsconfig.json
tsconfig.json
:
{
"include": [
"src/**/*",
"src/declaration.d.ts"
],
"exclude": [
"node_modules/*"
],
"compilerOptions": {
// other options
"outDir": "dist",
"allowJS": true
}
}
Is there a method to ensure that src/Images/error.png
is included in the dist
folder during execution of tsc
?