Plugins: something wrong with babel plugin and polyfill

Created on 22 Jun 2020  ·  4Comments  ·  Source: rollup/plugins

  • Rollup Plugin Name: @rollup/plugin-babel
  • Rollup Plugin Version:5.0.3
  • Rollup Version:2.17.1
  • Operating System (or Browser): chrome 83.0.4103.106
  • Node Version: v12.13.1

How Do We Reproduce?

reproduction : https://github.com/1o1w1/temp_rollup-polyfill
open /example/index.html

Expected Behavior

no error in /dist/temp.umd.js

Actual Behavior

image

demo is no error when i remove babel plugin. i think it is something wrong with polyfill.

t¹ 🐞 bug x⁷ ⋅ stale

All 4 comments

This looks like a Rollup bug around cyclic deps or similar to me.

commonjs plugin receives this file and transforms it to:

/* imports */
var _export = function() { /* fn body */ }
export default _export;
export { _export as __moduleExports };

So on its own, it looks just OK.

Babel plugin is just responsible for code transformation and it does its job on file by file basis - it doesn't resolve imports or anything like that. In the final output we can see this _exports being used before it gets declared. It appears in the output as its usage and an import statement to the module containing it has been inserted by Babel, but Babel itself has no control over how (and in what order) things get flat-bundled later.

@shellscape I'm afraid I won't have time to reduce this repro case to a minimal one, so it could be reported to Rollup itself.

Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

I need help , reopen the issue please @Andarist @shellscape

@1o1w1 please follow the advice above and post the the error and reproduction to rollup/rollup

Was this page helpful?
0 / 5 - 0 ratings