Skip to content
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

[ESM] Does not work with "type": "module" in "package.json" #56

Closed
cedx opened this issue Apr 27, 2019 · 2 comments
Closed

[ESM] Does not work with "type": "module" in "package.json" #56

cedx opened this issue Apr 27, 2019 · 2 comments

Comments

@cedx
Copy link

cedx commented Apr 27, 2019

I'm using the new ES modules features from Node.js 12 (the next LTS).

If I set my package to be an ESM one with the field type set to module in package.json file, the gulpfile.esm.js file stops working as expected.

import {spawn} from 'child_process';
       ^
SyntaxError: Unexpected token {

If I set the type field to commonjs, the gulpfile.esm.js file works as expected (but not my code which uses only ES modules).
It would be nice if interpret could manage this case (i.e. that the new ESM parser is already enabled).

@phated
Copy link
Member

phated commented Apr 27, 2019

It's likely not going to happen in interpret because then interpret would need to read package.json files. Maybe you want to open this on esm?

@phated phated closed this as completed Apr 27, 2019
@cedx
Copy link
Author

cedx commented Apr 27, 2019

OK, done: standard-things/esm#789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants