Targeting commonjs, when importing files with leading numbers in their names results in invalid js emitted.
Given these inputs:
10_lib.ts
main.ts
import { Foo } from './10_lib';
Foo();
Compiling with
$ tsc --modules commonjs main.ts
Generates
main.js
var 10_lib_1 = require('./10_lib');
10_lib_1.Foo();
Which is invalid, and when run errors with:
$ node main.js
.../main.js:1
(function (exports, require, module, __filename, __dirname) { var 10_lib_1 = r
^^
SyntaxError: Unexpected token ILLEGAL
Targeting commonjs, when importing files with leading numbers in their names results in invalid js emitted.
Given these inputs:
10_lib.ts
main.ts
Compiling with
Generates
main.js
Which is invalid, and when run errors with: