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 native ESM configs in Node 13, support untranspiled configs #3445
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via
or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #3445 +/- ##
==========================================
+ Coverage 95.08% 95.81% +0.72%
==========================================
Files 171 174 +3
Lines 5861 5898 +37
Branches 1732 1737 +5
==========================================
+ Hits 5573 5651 +78
+ Misses 156 127 -29
+ Partials 132 120 -12
Continue to review full report at Codecov.
|
3a23845
to
9acf722
Compare
22b4db0
to
a19cd1a
Compare
23fabd2
to
8c2d2e4
Compare
a19cd1a
to
674137d
Compare
94c2955
to
aad9f32
Compare
03d9fac
to
a7fe879
Compare
a7fe879
to
d2ba3e6
Compare
47d86be
to
944fb74
Compare
ccd3ceb
to
ff0e2e4
Compare
ff0e2e4
to
b906590
Compare
With the latest Rollup release, despite this merge, with import filesize from "./dist/index-esm.js"; ...and console.log(__dirname); Expected
Actual
|
1. Fix for __dirname? rollup/rollup#3445 2. Resume using `filesize` again in Rollup config; tests/add coverage? feat: replace `render` with `reporter` array BREAKING CHANGE: Removes `render`. Also adds sourcemaps and bumps some devDeps and drops unneeded ones
Please read the docs, you will only get an untranspiled config if you rename your config with an .mjs in Node 13 or .a cjs extension. Also I am not sure you can use |
Ah, my apologies, thank you! |
and from the docs:
But in my example, my relative imports are ESM, so shouldn't that work? (And I am on Node 10, FWIW.) I'm sorry to belabor this if I'm the one missing something, but I had taken a look at the docs, but was just unclear (and still am). Re: |
This is what breaks |
I would understand the bundle having the And even when testing on Node 12 with the |
FWIW, with |
And mjs is only working natively in Node 13, as stated in the docs. Otherwise the config file is the bundled file, hence everything points there. |
Ah, ok, I see. Re: the config file itself being the bundled file, I see now how that can make sense. Re: Node 13, my apologies, and thank you very much for your patience and help. |
….0.0 >=2.3.0 adds API support for CLI/config parsing: rollup/rollup#3445
….0.0 >=2.3.0 adds API support for CLI/config parsing: rollup/rollup#3445
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
resolves #3443
resolves #2953
This will add support for native ESM and untranspiled configs, which will solve two issues:
"type": "module"
folder, it could not import real ESM plugins in Node 13__dirname
andimport.meta.url
were wrongSupport will be based on file extension:
.cjs
, the config will assumed to be CommonJS and will be required untranspiled.mjs
AND the Node version is at least 13, the config will be assumed to be native ESM and will be imported untranspiledTODO:
rollup.config.mjs
,rollup.config.cjs
,rollup.config.js
.