File tree 2 files changed +5
-10
lines changed
packages/angular_devkit/build_webpack/src
2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import * as path from 'path';
10
10
import * as webpack from 'webpack' ;
11
11
12
12
export interface EmittedFiles {
13
+ id ?: string ;
13
14
name ?: string ;
14
15
file : string ;
15
16
initial : boolean ;
@@ -20,19 +21,11 @@ export interface EmittedFiles {
20
21
export function getEmittedFiles ( compilation : webpack . compilation . Compilation ) : EmittedFiles [ ] {
21
22
const files : EmittedFiles [ ] = [ ] ;
22
23
23
- // entrypoints might have multiple outputs
24
- // such as runtime.js
25
- for ( const [ name , entrypoint ] of compilation . entrypoints ) {
26
- const entryFiles : string [ ] = ( entrypoint && entrypoint . getFiles ( ) ) || [ ] ;
27
- for ( const file of entryFiles ) {
28
- files . push ( { name, file, extension : path . extname ( file ) , initial : true } ) ;
29
- }
30
- }
31
-
32
24
// adds all chunks to the list of emitted files such as lazy loaded modules
33
- for ( const chunk of Object . values ( compilation . chunks ) ) {
25
+ for ( const chunk of compilation . chunks as webpack . compilation . Chunk [ ] ) {
34
26
for ( const file of chunk . files as string [ ] ) {
35
27
files . push ( {
28
+ id : chunk . id . toString ( ) ,
36
29
name : chunk . name ,
37
30
file,
38
31
extension : path . extname ( file ) ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export interface WebpackFactory {
27
27
28
28
export type BuildResult = BuilderOutput & {
29
29
emittedFiles ?: EmittedFiles [ ] ;
30
+ webpackStats ?: webpack . Stats . ToJsonOutput ;
30
31
} ;
31
32
32
33
export function runWebpack (
@@ -59,6 +60,7 @@ export function runWebpack(
59
60
60
61
obs . next ( {
61
62
success : ! stats . hasErrors ( ) ,
63
+ webpackStats : stats . toJson ( ) ,
62
64
emittedFiles : getEmittedFiles ( stats . compilation ) ,
63
65
} as unknown as BuildResult ) ;
64
66
You can’t perform that action at this time.
0 commit comments