https://github.com/arendjr/rollup-commonjs-babel-issue
Minimal example showing issue with Rollup and the CommonJS and Babel plugins
https://github.com/arendjr/rollup-commonjs-babel-issue
Last synced: about 2 months ago
JSON representation
Minimal example showing issue with Rollup and the CommonJS and Babel plugins
- Host: GitHub
- URL: https://github.com/arendjr/rollup-commonjs-babel-issue
- Owner: arendjr
- Created: 2019-01-18T15:33:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-18T15:54:09.000Z (over 6 years ago)
- Last Synced: 2025-02-05T21:58:11.912Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rollup-commonjs-babel-issue
*Minimal example showing issue with Rollup and the CommonJS and Babel plugins*The issue is that `index.js` contains an ES6 class and with the transpilation
taking place, the CommonJS plugin no longer is able to process the `require()`
call (`MyComponent.js` is
never searched for).You can inspect `output.js` and see the `require("./MyComponent")` is still in
there verbatim.If `@babel/preset-env` weren't used, the ES6 class would not be transpiled and
the problem goes away. Similary, if a functional component had been used
instead of a class component, the problem goes away.If you want to recreate `output.js`, just run `yarn && yarn start`.