File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
packages/@vue/cli-service Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,30 @@ test('build', async () => {
63
63
expect ( h1Text ) . toMatch ( 'Welcome to Your Vue.js App' )
64
64
} )
65
65
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
+
66
90
afterAll ( async ( ) => {
67
91
if ( browser ) {
68
92
await browser . close ( )
Original file line number Diff line number Diff line change 75
75
"vue-loader-v16" : " npm:vue-loader@^16.1.0" ,
76
76
"vue-style-loader" : " ^4.1.2" ,
77
77
"webpack" : " ^4.0.0" ,
78
- "webpack-bundle-analyzer" : " ^3.8 .0" ,
78
+ "webpack-bundle-analyzer" : " ^4.1 .0" ,
79
79
"webpack-chain" : " ^6.4.0" ,
80
80
"webpack-dev-server" : " ^3.11.0" ,
81
81
"webpack-merge" : " ^4.2.2"
You can’t perform that action at this time.
0 commit comments