You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We specify which objects are visible outside the module by using the `export` keyword on a top-level declaration, similarly to how `export` defined the public surface area of a namespace.
224
224
225
-
To compile, we must specify a module target on the command line. For node.js, use `--module commonjs`; for require.js, use `--module amd`. For example:
225
+
To compile, we must specify a module target on the command line. For Node.js, use `--module commonjs`; for require.js, use `--module amd`. For example:
226
226
227
227
```Shell
228
228
tsc --module commonjs Test.ts
@@ -286,7 +286,7 @@ strings.forEach(s => {
286
286
287
287
## Code Generation for Modules
288
288
289
-
Depending on the module target specified during compilation, the compiler will generate appropriate code for either node.js (commonjs) or require.js (AMD) module-loading systems.
289
+
Depending on the module target specified during compilation, the compiler will generate appropriate code for either Node.js (commonjs) or require.js (AMD) module-loading systems.
290
290
For more information on what the `define` and `require` calls in the generated code do, consult the documentation for each module loader.
291
291
292
292
This simple example shows how the names used during importing and exporting get translated into the module loading code.
@@ -420,7 +420,7 @@ For this pattern to work, it's important that the symbol defined via an `import`
420
420
To maintain type safety, we can use the `typeof` keyword.
421
421
The `typeof` keyword, when used in a type position, produces the type of a value, in this case the type of the module.
0 commit comments