Skip to content

Commit 7f11c6a

Browse files
authored
Merge pull request #29 from rschristian/fix/bad-polyfill-replacement
fix: Incorrect extension removal in polyfill name replacement
2 parents 7c8840f + bd4583b commit 7f11c6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export default class OptimizePlugin {
248248
async generatePolyfillsChunk (polyfills, cwd, timings) {
249249
const ENTRY = '\0entry';
250250

251-
const entryContent = polyfills.reduce((str, p) => `${str}\nimport "${p.replace('.js', '')}";`, '');
251+
const entryContent = polyfills.reduce((str, p) => `${str}\nimport "${p.replace(/\.js$/, '')}";`, '');
252252

253253
const COREJS = require.resolve('core-js/package.json').replace('package.json', '');
254254
const isCoreJsPath = /(?:^|\/)core-js\/(.+)$/;

0 commit comments

Comments
 (0)