Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b711a05

Browse filesBrowse files
authored
fix(unit-mocha): shouldn't require webpack-4 plugin with cli-service v4 (#6215)
Note this plugin is compatible with cli-service v4, therefore users can upgrade to it separately for mocha major version upgrades
1 parent 2503ba6 commit b711a05
Copy full SHA for b711a05

File tree

Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Filter options
  • packages/@vue/cli-plugin-unit-mocha/generator
Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed

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

Copy file name to clipboardExpand all lines: packages/@vue/cli-plugin-unit-mocha/generator/index.js
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @type {import('@vue/cli').GeneratorPlugin} */
12
module.exports = (api, options, rootOptions, invoking) => {
23
const isVue3 = rootOptions && rootOptions.vueVersion === '3'
34

@@ -7,8 +8,12 @@ module.exports = (api, options, rootOptions, invoking) => {
78
hasRouter: api.hasPlugin('router')
89
})
910

10-
// mochapack currently does not support webpack 5 yet
11-
require('@vue/cli-plugin-webpack-4/generator')(api, {}, rootOptions, invoking)
11+
const { semver } = require('@vue/cli-shared-utils')
12+
const cliServiceVersion = require('@vue/cli-service/package.json').version
13+
if (semver.gte(cliServiceVersion, '5.0.0-0')) {
14+
// mochapack currently does not support webpack 5 yet
15+
require('@vue/cli-plugin-webpack-4/generator')(api, {}, rootOptions, invoking)
16+
}
1217

1318
api.extendPackage({
1419
devDependencies: {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.