File tree 3 files changed +8
-5
lines changed
packages/angular_devkit/build_optimizer
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 52
52
"@types/semver" : " ^5.3.30" ,
53
53
"@types/source-map" : " ^0.5.0" ,
54
54
"@types/webpack" : " ^3.0.2" ,
55
+ "@types/webpack-sources" : " ^0.1.3" ,
55
56
"common-tags" : " ^1.3.1" ,
56
57
"conventional-changelog" : " ^1.1.0" ,
57
58
"glob" : " ^7.0.3" ,
71
72
"ts-node" : " ^2.0.0" ,
72
73
"tslint" : " ^5.5.0" ,
73
74
"typescript" : " ~2.3.0" ,
74
- "v8-profiler" : " ^5.7.0"
75
+ "v8-profiler" : " ^5.7.0" ,
76
+ "webpack-sources" : " ^1.0.1"
75
77
},
76
78
"devDependencies" : {
77
79
"protobufjs" : " 5.0.0"
Original file line number Diff line number Diff line change 11
11
"dependencies" : {
12
12
"loader-utils" : " ^1.1.0" ,
13
13
"source-map" : " ^0.5.6" ,
14
- "typescript" : " ^2.3.3"
14
+ "typescript" : " ^2.3.3" ,
15
+ "webpack-sources" : " ^1.0.1"
15
16
}
16
17
}
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
import * as webpack from 'webpack' ;
9
+ import { ConcatSource , RawSource } from 'webpack-sources' ;
9
10
import { purify } from './purify' ;
10
11
11
12
@@ -23,9 +24,8 @@ export class PurifyPlugin {
23
24
chunk . files
24
25
. filter ( ( fileName : string ) => fileName . endsWith ( '.js' ) )
25
26
. forEach ( ( fileName : string ) => {
26
- const purifiedSource = purify ( compilation . assets [ fileName ] . source ( ) ) ;
27
- compilation . assets [ fileName ] . _cachedSource = purifiedSource ;
28
- compilation . assets [ fileName ] . _source . source = ( ) => purifiedSource ;
27
+ const purified : string = purify ( compilation . assets [ fileName ] . source ( ) ) ;
28
+ compilation . assets [ fileName ] = new ConcatSource ( new RawSource ( purified ) ) ;
29
29
} ) ;
30
30
} ) ;
31
31
callback ( ) ;
You can’t perform that action at this time.
0 commit comments