You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
The CommonJS plugin doesn't handle ES6 transpile-style exports very well. I present two examples why support must be improved:
Because this isn't very nice
// sourceexportdefaultfunction(){return1337;}
// after babel"use strict";exports.__esModule=true;exports["default"]=function(){return1337;};module.exports=exports["default"];
// after rollup-plugin-commonjsvarleet=(function(module){varexports=module.exports;"use strict";exports.__esModule=true;exports["default"]=function(){return1337;};module.exports=exports["default"];returnmodule.exports;})({exports:{}});var__esModule=leet.__esModule;export{__esModule};exportdefaultleet;
We do not give exports['default'] special treatment.
// after rollup-plugin-commonjsimportrequire$$0from'core-js/library/fn/get-iterator';vargetIterator=(function(module){varexports=module.exports;module.exports={"default": require$$0,__esModule: true};returnmodule.exports;// an object is exported, not a function})({exports:{}});exportdefaultgetIterator;
The text was updated successfully, but these errors were encountered:
@Victorystick sorry to bring back old memories but was this solved for you? I have trouble when the plugin seems to run over core-js code which then ends up in babel. This code seems to break my build
The CommonJS plugin doesn't handle ES6 transpile-style exports very well. I present two examples why support must be improved:
Because this isn't very nice
That's quite a bit of bloat.
Worse: code like this breaks
We do not give
exports['default']
special treatment.The text was updated successfully, but these errors were encountered: