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

support naming the config file *.mjs like rollup.config.mjs #3189

Closed
arlac77 opened this issue Oct 25, 2019 · 2 comments
Closed

support naming the config file *.mjs like rollup.config.mjs #3189

arlac77 opened this issue Oct 25, 2019 · 2 comments

Comments

@arlac77
Copy link
Contributor

arlac77 commented Oct 25, 2019

Feature Use Case

renaming all ESM modules into *.mjs (even build time & cfg)

Feature Proposal

support naming the rollup config file rollup.config.mjs (not .js)

currently an error is thrown

rollup -c tests/rollup.config.mjs 
[!] Error: Must use import to load ES Module: .../tests/rollup.config.mjs
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: ...tests/rollup.config.mjs
    at Object.Module._extensions..mjs (internal/modules/cjs/loader.js:1007:9)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at /usr/lib/node_modules/rollup/dist/bin/rollup:845:32
@shellscape
Copy link
Contributor

@Rich-Harris thoughts?

lukastaegert pushed a commit that referenced this issue Oct 31, 2019
* feat: support *.mjs as config file extension

see #3189

* docs: add *.mjs cli example

* fix: overwrite loder for the extension of the actual config file
@arlac77
Copy link
Contributor Author

arlac77 commented Nov 1, 2019

fixed with #3204

@arlac77 arlac77 closed this as completed Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants