Skip to content

Commit bd4583b

Browse files
committed
fix: Need regex replace, not string
1 parent ac612f9 commit bd4583b

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)