Skip to content

Commit 928f915

Browse files
authored
chore: webpack-bundle-analyzer to ^4.1.0 (#6092)
Fixes: #6091
1 parent 6da5df4 commit 928f915

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,30 @@ test('build', async () => {
6363
expect(h1Text).toMatch('Welcome to Your Vue.js App')
6464
})
6565

66+
test('build with --report-json', async () => {
67+
const project = await create('e2e-build-report-json', defaultPreset)
68+
69+
const { stdout } = await project.run('vue-cli-service build --report-json')
70+
expect(stdout).toMatch('Build complete.')
71+
// should generate report.json
72+
expect(project.has('dist/report.json')).toBe(true)
73+
74+
const report = JSON.parse(await project.read('dist/report.json'))
75+
// should contain entry points info
76+
expect(report.entrypoints).toHaveProperty('app.chunks')
77+
expect(report.entrypoints).toHaveProperty('app.assets')
78+
79+
const appChunk = report.chunks.find(chunk => chunk.id === 'app')
80+
// Each chunk should contain meta info
81+
expect(appChunk).toHaveProperty('rendered')
82+
expect(appChunk).toHaveProperty('initial')
83+
expect(appChunk).toHaveProperty('entry')
84+
expect(appChunk).toHaveProperty('size')
85+
expect(appChunk).toHaveProperty('names')
86+
expect(appChunk).toHaveProperty('files')
87+
expect(appChunk).toHaveProperty('modules')
88+
})
89+
6690
afterAll(async () => {
6791
if (browser) {
6892
await browser.close()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"vue-loader-v16": "npm:vue-loader@^16.1.0",
7676
"vue-style-loader": "^4.1.2",
7777
"webpack": "^4.0.0",
78-
"webpack-bundle-analyzer": "^3.8.0",
78+
"webpack-bundle-analyzer": "^4.1.0",
7979
"webpack-chain": "^6.4.0",
8080
"webpack-dev-server": "^3.11.0",
8181
"webpack-merge": "^4.2.2"

0 commit comments

Comments
 (0)