Andrew Bradley

Results 546 comments of Andrew Bradley
trafficstars

@NeilujD this is perfect, thanks. It looks like, due to missing features in node's ESM support, mocha is using a hack to figure out whether a file should be loaded...

I think I can hack this by delegating to node's built-in `.js` extension, passing a fake filename. ``` require.extensions['.js']({_compile(){}}, filename + 'DOESNOTEXIST.js') ``` At the cost of a failed `fs`...

@castarco the problem is cross-platform support that matches the npm ecosystem without adding complexity to ts-node. Typically this is handled by the package manager: npm, yarn, pnpm, etc. We set...

@NeilujD The mocha issue you were seeing should be fixed by #1031 which has been merged to master. If you're feeling adventurous, you can install ts-node directly from master. ```...

@zenflow thanks, much appreciated. Including file extensions is tricky; you need to include them in the way that typescript wants, which is to include the `.js` extension, not the `.ts`...

@thatsmydoing Thanks for sharing your experience; I'm sure it will help other people, too. You should be able to omit `--experimental-modules` because it is implied by `--loader`. We merged #1028...

@akbr Good catch, thanks. It looks like files loaded as ESM have file:// URLs instead of paths. We install `source-map-support` here: https://github.com/TypeStrong/ts-node/blob/master/src/index.ts#L445-L451 It's a third-party library that handles sourcemaps automatically,...

Check node's docs which explain the differences between the ESM and CJS contexts. On Thu, Jun 11, 2020, 7:47 PM Gen Hames wrote: > Is there an easy answer to...

Set it in your tsconfig file. The SchemaStore schema for tsconfig, which is used for tabcompletion in modern editors, includes the ts-node options. Environment variables should work, too On Sat,...

@VladimirGrenaderov Thanks, can you file this as an issue to help track implementation of a fix?