TypeScript Compile Options: module vs target
There are 2 different things. --target
simply means which version of ECMAScript you're using to code. --module
simply means which module system you're using such as commonjs
for Node or ES module for all that supports it and what not.
A more detailed explanation is here : Understanding "target" and "module" in tsconfig
See also: Understanding "target" and "module" in tsconfig.
Here is a quote from the documentation on compiler options:
--target
Specify ECMAScript target version: 'es3' (default), 'es5', or 'es6'.
--module
Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', or 'es2015'.
- Only 'amd' and 'system' can be used in conjunction with --outFile.
- 'es6' and 'es2015' values may be used when targeting ES5 or lower.