Skip to content

Commit f683583

Browse files
committed
fix: fix file name resovling in mocha env
1 parent 52dbdf8 commit f683583

File tree

1 file changed

+6
-0
lines changed
  • packages/@vue/cli-plugin-unit-mocha

1 file changed

+6
-0
lines changed

packages/@vue/cli-plugin-unit-mocha/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ module.exports = api => {
1515
options.optimizeSSR = false
1616
return options
1717
})
18+
19+
const isLegacyBundle = process.env.VUE_CLI_MODERN_MODE && !process.env.VUE_CLI_MODERN_BUILD
20+
// mocha-webpack cannot deal with the query parameter in filename
21+
webpackConfig
22+
.output
23+
.filename(isLegacyBundle ? '[name]-legacy.js?' : '[name].js')
1824
}
1925
})
2026

0 commit comments

Comments
 (0)