Skip to content

Commit b4af27a

Browse files
authored
feat: support webpack 5 in unit-mocha plugin (#6471)
mochapack 2.1.0 has added webpack 5 support Closes #6412
1 parent ee9a8d2 commit b4af27a

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

Diff for: packages/@vue/cli-plugin-unit-mocha/generator/index.js

-8
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@ module.exports = (api, options, rootOptions, invoking) => {
88
hasRouter: api.hasPlugin('router')
99
})
1010

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-
}
17-
1811
api.extendPackage({
1912
devDependencies: {
20-
'@vue/cli-plugin-webpack-4': require('../package.json').dependencies['@vue/cli-plugin-webpack-4'],
2113
'@vue/test-utils': isVue3 ? '^2.0.0-0' : '^1.1.3',
2214
'chai': '^4.2.0'
2315
},

Diff for: packages/@vue/cli-plugin-unit-mocha/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
},
2323
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/cli-plugin-unit-mocha#readme",
2424
"dependencies": {
25-
"@vue/cli-plugin-webpack-4": "^5.0.0-beta.0",
2625
"@vue/cli-shared-utils": "^5.0.0-beta.0",
2726
"jsdom": "^16.4.0",
2827
"jsdom-global": "^3.0.2",
2928
"mocha": "^8.3.0",
30-
"mochapack": "^2.0.2"
29+
"mochapack": "^2.1.0"
3130
},
3231
"devDependencies": {
3332
"@types/chai": "^4.2.15",

Diff for: yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -15706,10 +15706,10 @@ mocha@^8.0.1, mocha@^8.3.0:
1570615706
yargs-parser "20.2.4"
1570715707
yargs-unparser "2.0.0"
1570815708

15709-
mochapack@^2.0.2:
15710-
version "2.0.6"
15711-
resolved "https://registry.yarnpkg.com/mochapack/-/mochapack-2.0.6.tgz#79bee97a3d300c890816ce6cf374c5fb5053dec0"
15712-
integrity sha512-6ijz1pJlSnzuy0PXEZKhO2QRrZ1RSI8ZEQ2Rk9jvGAm7dyXXrYcyd8hMmrBXSJSLnZqRuKV0e1SAYQJxYSlfEg==
15709+
mochapack@^2.1.0:
15710+
version "2.1.0"
15711+
resolved "https://registry.yarnpkg.com/mochapack/-/mochapack-2.1.0.tgz#45b9ddda909443cf8fbd9020be5d606e2c5be193"
15712+
integrity sha512-m/h4qVcsNfLZcCph0OfYaeHcXaRjf3DtswAk09uOj7h7JMlVaDMDCzMxZ6M6uNfeh4LJT9f3wUwgChTyrdLtxA==
1571315713
dependencies:
1571415714
"@babel/runtime-corejs2" "^7.0.0"
1571515715
chalk "^2.4.2"

0 commit comments

Comments
 (0)