Within my project's tsconfig.json
, I have specified the following:
"include": [
"src/**/*",
"generated**/*"
]
In the directory, there exist two files named src/main.ts
and generated/data.json
.
The task at hand is to be able to successfully execute import data from 'data.json';
within src/main.ts
. However, this only seems feasible if generated/data.json
is relocated to the src
directory.
The build process involves using both webpack
and ts-loader
to generate a final bundle.
Various attempts have been made, including experimenting with rootDirs
and path mapping in tsconfig
to facilitate the connection between src/main.ts
and data.json
, yet the desired outcome remains elusive.