Skip to content

Commit

Permalink
fix(bundler): enable tracing @babel/polyfill
Browse files Browse the repository at this point in the history
core-js uses "var define = ..." everywhere, we need to force cjs wrap before we can switch to dumberjs bundler.
  • Loading branch information
3cp committed Feb 10, 2019
1 parent 02d1cd0 commit 1bef893
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/build/bundled-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ exports.BundledSource = class {
let contents;
// forceCjsWrap bypasses a r.js parse bug.
// See lib/amodro-trace/read/cjs.js for more info.
let forceCjsWrap = !!modulePath.match(/(\/|\\)(cjs|commonjs)(\/|\\)/i);
let forceCjsWrap = !!modulePath.match(/(\/|\\)(cjs|commonjs)(\/|\\)/i) ||
// core-js uses "var define = ..." everywhere, we need to force cjs
// before we can switch to dumberjs bundler
(desc && desc.name === 'core-js');

try {
contents = cjsTransform(modulePath, this.contents, forceCjsWrap);
Expand Down

0 comments on commit 1bef893

Please sign in to comment.