Skip to content

Commit 7c39263

Browse files
committed
fix prevent writing non js files
1 parent 4a5b4c1 commit 7c39263

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/hmr.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ const close = () => {
2727

2828
const emptyBundle = bundle => {
2929
for (const key of Object.keys(bundle)) {
30+
if (!key.endsWith('.js')) continue
3031
delete bundle[key]
3132
}
3233
}
3334

3435
const applyBundleBasePath = (basePath, bundle) => {
3536
for (const key of Object.keys(bundle)) {
37+
if (!key.endsWith('.js')) continue
3638
const chunk = bundle[key]
3739
delete bundle[key]
3840
const newFileName = path.join(basePath, chunk.fileName)

0 commit comments

Comments
 (0)