This is my tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"outFile": "./js/app.js",
"typeRoots": [
"./node_modules/@types"
],
"types" : [ "node", "core-js" ]
},
"include": [
"./ts/**/*.ts"
],
"exclude": [
"**/*.spec.ts"
]
}
This is my system.config.js
(Basically nothing)
System.import('main');
My goal is to consolidate all scripts into a single JS file for production use. TypeScript has helped with this, creating the bundled app.js
.
However, I encountered
http://localhost/@angular/platform-browser-dynamic 404 (Not Found)
in the browser console.
Upon inspecting the app.js
file, I noticed that all @angular and RxJS code were not included in the bundle. As a result, SystemJS could not locate them and attempted to request the script files conventionally.
According to my understanding, the line "moduleResolution": "node"
in the tsconfig.json
file should instruct TypeScript to load @angular and RxJS using the Node resolution method, which entails searching in the node_modules
directory. However, this does not seem to be happening as expected.