Skip to content

Commit 428d172

Browse files
DRoethaoqunjiang
authored andcommitted
feat: upgrade webpack (vuejs#4253)
1 parent 1cf9b14 commit 428d172

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
@@ -78,7 +78,7 @@
7878
"semver": "^6.1.0",
7979
"typescript": "^3.4.5",
8080
"vuepress": "^1.0.1",
81-
"webpack": ">=4 < 4.29",
81+
"webpack": "^4.0.0",
8282
"yorkie": "^2.0.0"
8383
},
8484
"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": "^4.0.0-beta.3",
2525
"@vue/cli-shared-utils": "^4.0.0-beta.3",
2626
"babel-loader": "^8.0.6",
27-
"webpack": ">=4 < 4.29"
27+
"webpack": "^4.0.0"
2828
},
2929
"peerDependencies": {
3030
"@vue/cli-service": "^3.0.0 || ^4.0.0-0"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@vue/cli-shared-utils": "^4.0.0-beta.3",
2727
"eslint-loader": "^2.1.2",
2828
"globby": "^9.2.0",
29-
"webpack": ">=4 < 4.29",
29+
"webpack": "^4.0.0",
3030
"yorkie": "^2.0.0"
3131
},
3232
"peerDependencies": {

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": "^4.0.0-beta.3",
27-
"webpack": ">=4 < 4.29",
27+
"webpack": "^4.0.0",
2828
"workbox-webpack-plugin": "^4.3.1"
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": "^6.0.1",
3131
"tslint": "^5.16.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
@@ -73,7 +73,7 @@
7373
"thread-loader": "^2.1.2",
7474
"url-loader": "^2.1.0",
7575
"vue-loader": "^15.7.0",
76-
"webpack": ">=4 < 4.29",
76+
"webpack": "^4.0.0",
7777
"webpack-bundle-analyzer": "^3.3.2",
7878
"webpack-chain": "^6.0.0",
7979
"webpack-dev-server": "^3.4.1",

0 commit comments

Comments
 (0)