February 2019
Beginner
694 pages
18h 4m
English
In order to compile our code to use the AMD module syntax, we will need to change the module setting in our tsconfig.json file, as follows:
{
"compilerOptions": {
"module": "amd",
"target": "es5",
"noImplicitAny": false,
"sourceMap": false
},
"exclude": [
"node_modules"
]
}
Here, we have specified the "module" parameter to be "amd", instead of "commonjs". This change specifies to the TypeScript compiler that the output of the compilation step must generate JavaScript code that uses the AMD module syntax. Let's take a look at what this means in terms of our module files.
Consider the following TypeScript module definition, as found in our lib/Module3.ts file:
export class Module3 { print() { console.log(`Module3.print()`); ...Read now
Unlock full access