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
Using ES Modules is fine, but require calls are behaving unexpectedly.
Create a file eg /path/to/transform.js:
const{ a }=require('./a');exportdefaultbabel=>{const{types: t}=babel;console.log(a());return{visitor: {Program(path){path.traverse({enter(path){t.removeComments(path.node);}});}}};};
This CommonJS example doesn't error like it does in Electron (Electron could be a factor) but it also doesn't bundle in the contents of /path/to/a.js – it leaves the require calls there.
Description
Using ES Modules is fine, but
require
calls are behaving unexpectedly.Create a file eg
/path/to/transform.js
:Create a file eg
/path/to/a.js
:Select
babelv7
in the Transform MenuChoose
/path/to/transform.js
Expected Output
Actual Output
rollup.js REPL Examples
This ES Modules example is fine.
This CommonJS example doesn't error like it does in Electron (Electron could be a factor) but it also doesn't bundle in the contents of
/path/to/a.js
– it leaves the require calls there.Suggested Solution
https://github.com/rollup/rollup-plugin-node-resolve and/or https://github.com/rollup/rollup-plugin-commonj might possibly be needed.
Help Needed
Ideas welcome, I'm stuck so far after an hour or two working on this.
The text was updated successfully, but these errors were encountered: