8000 feat: upgrade webpack (#4253) · vuejs/vue-cli@9525f67 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9525f67

Browse files
DRoethaoqunjiang
authored andcommitted
feat: upgrade webpack (#4253)
(cherry picked from commit 428d172)
1 parent 61485f6 commit 9525f67

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"typescript": "^3.4.3",
7272
"vuepress": "1.0.0-alpha.44",
7373
"vuepress-theme-vue": "^1.1.0",
74-
"webpack": ">=4 < 4.29",
74+
"webpack": "^4.0.0",
7575
"yorkie": "^2.0.0"
7676
},
7777
"resolutions": {

packages/@vue/cli-plugin-babel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@vue/babel-preset-app": "^3.10.0",
2525
"@vue/cli-shared-utils": "^3.10.0",
2626
"babel-loader": "^8.0.5",
27-
"webpack": ">=4 < 4.29"
27+
"webpack": "^4.0.0"
2828
},
2929
"publishConfig": {
3030
"access": "public"

packages/@vue/cli-plugin-eslint/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"babel-eslint": "^10.0.1",
2828
"eslint-loader": "^2.1.2",
2929
"globby": "^9.2.0",
30-
"webpack": ">=4 < 4.29",
30+
"webpack": "^4.0.0",
3131
"yorkie": "^2.0.0"
3232
},
3333
"optionalDependencies": {

packages/@vue/cli-plugin-pwa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"dependencies": {
2626
"@vue/cli-shared-utils": "^3.10.0",
27-
"webpack": ">=4 < 4.29",
27+
"webpack": "^4.0.0",
2828
"workbox-webpack-plugin": "^3.6.3"
2929
},
3030
"devDependencies": {

packages/@vue/cli-plugin-typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"globby": "^9.2.0",
3030
"ts-loader": "^5.3.3",
3131
"tslint": "^5.15.0",
32-
"webpack": ">=4 < 4.29",
32+
"webpack": "^4.0.0",
3333
"yorkie": "^2.0.0"
3434
},
3535
"peerDependencies": {

packages/@vue/cli-service/__tests__/multiPage.spec.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,16 @@ test('build w/ multi page', async () => {
9999
const assertSharedAssets = file => {
100100
// should split and preload vendor chunk
101101
expect(file).toMatch(/<link [^>]*js\/chunk-vendors[^>]*\.js rel=preload as=script>/)
102-
// should split and preload common js and css
103-
expect(file).toMatch(/<link [^>]*js\/chunk-common[^>]*\.js rel=preload as=script>/)
104-
expect(file).toMatch(/<link [^>]*chunk-common[^>]*\.css rel=preload as=style>/)
105-
// should load common css
106-
expect(file).toMatch(/<link href=\/css\/chunk-common\.\w+\.css rel=stylesheet>/)
107-
// should load common js
108102
expect(file).toMatch(/<script [^>]*src=\/js\/chunk-vendors\.\w+\.js>/)
109-
expect(file).toMatch(/<script [^>]*src=\/js\/chunk-common\.\w+\.js>/)
110103
}
111104

112105
const index = await project.read('dist/index.html')
113106
assertSharedAssets(index)
107+
// should split and preload common js and css
108+
expect(index).toMatch(/<link [^>]*js\/chunk-common[^>]*\.js rel=preload as=script>/)
109+
expect(index).toMatch(/<script [^>]*src=\/js\/chunk-common\.\w+\.js>/)
110+
expect(index).toMatch(/<link href=\/css\/chunk-common\.\w+\.css rel=stylesheet>/)
111+
expect(index).toMatch(/<link [^>]*chunk-common[^>]*\.css rel=preload as=style>/)
114112
// should preload correct page file
115113
expect(index).toMatch(/<link [^>]*js\/index[^>]*\.js rel=preload as=script>/)
116114
expect(index).not.toMatch(/<link [^>]*js\/foo[^>]*\.js rel=preload as=script>/)
@@ -140,6 +138,11 @@ test('build w/ multi page', async () => {
140138

141139
const bar = await project.read('dist/bar.html')
142140
assertSharedAssets(bar)
141+
// bar & index have a shared common chunk (App.vue)
142+
expect(bar).toMatch(/<link [^>]*js\/chunk-common[^>]*\.js rel=preload as=script>/)
143+
expect(bar).toMatch(/<script [^>]*src=\/js\/chunk-common\.\w+\.js>/)
144+
expect(bar).toMatch(/<link href=\/css\/chunk-common\.\w+\.css rel=stylesheet>/)
145+
expect(bar).toMatch(/<link [^>]*chunk-common[^>]*\.css rel=preload as=style>/)
143146
// should preload correct page file
144147
expect(bar).not.toMatch(/<link [^>]*js\/index[^>]*\.js rel=preload as=script>/)
145148
expect(bar).not.toMatch(/<link [^>]*js\/foo[^>]*\.js rel=preload as=script>/)

packages/@vue/cli-service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"thread-loader": "^2.1.2",
7575
"url-loader": "^1.1.2",
7676
"vue-loader": "^15.7.0",
77-
"webpack": ">=4 < 4.29",
77+
"webpack": "^4.0.0",
7878
"webpack-bundle-analyzer": "^3.3.0",
7979
"webpack-chain": "^4.11.0",
8080
"webpack-dev-server": "^3.4.1",

0 commit comments

Comments
 (0)
0