Corrupted bundle when including babel-polyfill
See original GitHub issueHello!
I’ve spot a very tricky situation when including the babel-polyfill and building with bankai. There’s a repository here to reproduce the error.
During the build phase, bankai is applying tinyify transformation that minifies code, but also removes the function wrappers around each module. When babel-polyfill is added, it creates several variable conflicts between modules, and the generated bundle becomes unusable.
This doesn’t happen when:
- using
bankai start
command - using bundle-collapser plugin instead of browser-pack-flat plugin, which requires to set
flat
option tofalse
. As bankai doesn’t allow to set this option, it must be changed manually in node_modules
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Corrupted Javascript bundle in Production but running fine ...
I've a React app with node server and I had perfectly fine production bundle a few days ago but recently my production bundle...
Read more >babel/polyfill
Babel includes a polyfill that includes a custom regenerator runtime and core-js. This will emulate a full ES2015+ environment (no < Stage 4...
Read more >Babel polyfill documentation for Webpack is wrong ...
When '@babel/polyfill' is included in webpack entry point as per documentation and "useBuiltIns": "entry" is used then then @babel/polyfill is ...
Read more >4 Reasons Why Your Source Maps are Broken
Source maps are awesome... when they work. Here are four reasons why your source maps are broken and tips on how to fix...
Read more >Error Boundaries
In the past, JavaScript errors inside components used to corrupt React's ... consider including a Function.name polyfill in your bundled application, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ohh i see, browser-pack-flat is not renaming the
Math
variable defined in one of core-js’s modules. a quick fix would be to add knowledge of global browser variables to browser-pack-flat. a better one would be to keep track of all undefined variables used by each module and assume all of them are globals. i’ll check out if the latter is doable and otherwise add the former for nowthanks for the repro!
assuming this is resolved then 😃 thanks!