-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readConfig should enforce "module":"commonjs" #293
Comments
No thanks. The module behaves how it should. If you need to override it, create a new |
Some explanation would be nice... Do you have a suggested work around for the problem? |
What didn't you like about the explanation? It's in the comment above. |
Huh? All you said was "No thanks". |
Please just scroll up. |
Ok now github has loaded your edited comment. |
No worries, I didn't add it initially when I hit enter but I edited it back in before you commented. Sorry for the confusion. I was trying to find a similar issue to this one from the past for reference, but couldn't find it. I'll try again now. |
See #212. |
By the way, are you using the CLI or with Gulp/mocha/etc? If you're using the CLI, it's very easy to use the |
Using gulp. I noticed definitions were released for Gulp v4 recently so thought I would have a crack at a typescript build pipeline. Right now I have done this: gulpfile.js // Gulp tasks are written in typescript.
// We use https://github.com/TypeStrong/ts-node to transpile on the fly.
require('ts-node').register
({
// Typechecking will be done by your IDE anyway,
// so lets not bother doing it at runtime.
fast: true,
// Node does not yet understand ES6 modules
compilerOptions:
{
module: "commonjs"
}
});
// Load all tasks from the tasks directory.
require('require-dir')('./tasks', { recurse: true }); |
Cool, that looks like it should work. FWIW, Gulp does load |
Until node supports es6 modules fully, it makes no sense to have typescript transpile to anything other than commonjs.
My project uses a tsconfig.json file with:
And thus ts-node fails with my typescript gulp file.
All I am suggesting is to add:
Alternatively if #4 was developed, it could possibly solve this issue as well.
The text was updated successfully, but these errors were encountered: