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

Consider supporting webpack.config.mjs alongside webpack.config.js #6566

Closed
TomasHubelbauer opened this issue Feb 25, 2018 · 7 comments
Closed

Comments

@TomasHubelbauer
Copy link

Do you want to request a feature or report a bug?
Feature.

What is the current behavior?
webpack.config.mjs cannot be used in place of webpack.config.js.

What is the expected behavior?
webpack.config.mjs could be used instead of webpack.config.js.

If this is a feature request, what is motivation or use case for changing the behavior?
Consistency.

@Jessidhia
Copy link
Member

It's a valid request, but not possible to do without changing the config loading to be asynchronous and using import() (only available as of node 9.5.0?)

@TomasHubelbauer
Copy link
Author

@Kovensky There is --experimental-modules which could be set to enable import, but I've mostly opened this feature request so it's tracked for when in the future doing this is feasible. Right now ECMAScript module support is still too new.

@sokra
Copy link
Member

sokra commented Feb 25, 2018

It's a valid request, but not possible to do without changing the config loading to be asynchronous and using import() (only available as of node 9.5.0?)

That shouldn't be an issue. We already support exporting a promise from webpack.config.js.

@sokra
Copy link
Member

sokra commented Feb 25, 2018

@webpack-bot move to webpack/webpack-cli

@webpack-bot
Copy link
Contributor

I've moved it to webpack/webpack-cli.

@damianobarbati
Copy link

Is this approved? Can we define webpack.config.mjs in next versions?

@TomasHubelbauer
Copy link
Author

@damianobarbati See the moved issue webpack/webpack-cli#282. This will probably take a good, good bit of time to be implemented and released.

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

5 participants