@@ -74,7 +74,6 @@ function _createAotPlugin(wco: WebpackConfigOptions, options: any) {
74
74
} , options ) ) ;
75
75
}
76
76
77
-
78
77
export const getNonAotConfig = function ( wco : WebpackConfigOptions ) {
79
78
const { appConfig, projectRoot } = wco ;
80
79
const tsConfigPath = path . resolve ( projectRoot , appConfig . root , appConfig . tsconfig ) ;
@@ -86,7 +85,7 @@ export const getNonAotConfig = function(wco: WebpackConfigOptions) {
86
85
} ;
87
86
88
87
export const getAotConfig = function ( wco : WebpackConfigOptions ) {
89
- const { projectRoot, appConfig } = wco ;
88
+ const { projectRoot, buildOptions , appConfig } = wco ;
90
89
const tsConfigPath = path . resolve ( projectRoot , appConfig . root , appConfig . tsconfig ) ;
91
90
const testTsConfigPath = path . resolve ( projectRoot , appConfig . root , appConfig . testTsconfig ) ;
92
91
@@ -99,8 +98,16 @@ export const getAotConfig = function(wco: WebpackConfigOptions) {
99
98
pluginOptions . exclude = exclude ;
100
99
}
101
100
101
+ let ngoLoader : any = [ ] ;
102
+ if ( buildOptions . ngo ) {
103
+ ngoLoader = [ {
104
+ loader : 'ngo-loader' ,
105
+ options : { sourceMap : buildOptions . sourcemaps }
106
+ } ] ;
107
+ }
108
+
102
109
return {
103
- module : { rules : [ { test : / \. t s $ / , loader : webpackLoader } ] } ,
110
+ module : { rules : [ { test : / \. t s $ / , use : [ ... ngoLoader , webpackLoader ] } ] } ,
104
111
plugins : [ _createAotPlugin ( wco , pluginOptions ) ]
105
112
} ;
106
113
} ;
0 commit comments