Initializing my TypeScript file with the import statement below. It's important to note that the lack of a .ts extension indicates that I am importing a TypeScript module:
import githubService from './github.service';
Through transpilation, the import statement becomes:
var github_service_1 = require('./github.service');
However, when SystemJS attempts to load this module, it makes an HTTP request of the form:
GET /github.service
instead of GET /github.service.js
. This approach clearly does not yield the desired outcome.
How can I configure TypeScript to function smoothly with SystemJS?
Below is the content of my tsconfig.json file:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "./dist",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true
},
"exclude": [
"node_modules"
],
"compileOnSave": false
}
I also attempted to switch the module
setting to system
(transitioning from CommonJS to SystemJS as the module format), yet the issue persisted.