I am encountering an issue with non-ts modules (text assets) not being transferred to the outDir as specified in tsconfig.json (or I might not be performing the task correctly).
Here is a simple example to reproduce the issue:
// /src/main.ts
import text from 'text.dat'
console.log( text )
// /src/a.d.ts
declare module 'text.dat' {
const value: string;
export default value
}
// /tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
...
"outFile": "./public/bundle.js",
"outDir": "./public",
...
// /public/a.html
...
<script type="text/javascript" src="bundle.js"></script>
<script>
SystemJS.import('main');
</script>
...
When the transpiled javascript attempts to load my text module as http://localhost:8082/text.dat, it results in a HTTP 404 error because the original file is located in the /src folder and is not being copied over to /public.
What am I overlooking?
For what it's worth, the complete source for reproducing this issue can be found at https://github.com/duzenko/typescript-non-ts-module-bundle