@@ -49,17 +49,16 @@ function _pluginOptionsOverrides(
49
49
50
50
function _createAotPlugin (
51
51
wco : WebpackConfigOptions ,
52
- options : any ,
53
- useMain = true ,
54
- extract = false ,
52
+ options : AngularCompilerPluginOptions ,
53
+ i18nExtract = false ,
55
54
) {
56
55
const { root, buildOptions } = wco ;
57
56
58
57
const i18nInFile = buildOptions . i18nFile
59
58
? path . resolve ( root , buildOptions . i18nFile )
60
59
: undefined ;
61
60
62
- const i18nFileAndFormat = extract
61
+ const i18nFileAndFormat = i18nExtract
63
62
? {
64
63
i18nOutFile : buildOptions . i18nFile ,
65
64
i18nOutFormat : buildOptions . i18nFormat ,
@@ -79,7 +78,7 @@ function _createAotPlugin(
79
78
}
80
79
81
80
let pluginOptions : AngularCompilerPluginOptions = {
82
- mainPath : useMain ? path . join ( root , buildOptions . main ) : undefined ,
81
+ mainPath : path . join ( root , buildOptions . main ) ,
83
82
...i18nFileAndFormat ,
84
83
locale : buildOptions . i18nLocale ,
85
84
platform : buildOptions . platform === 'server' ? PLATFORM . Server : PLATFORM . Browser ,
@@ -108,7 +107,7 @@ export function getNonAotConfig(wco: WebpackConfigOptions) {
108
107
} ;
109
108
}
110
109
111
- export function getAotConfig ( wco : WebpackConfigOptions , extract = false ) {
110
+ export function getAotConfig ( wco : WebpackConfigOptions , i18nExtract = false ) {
112
111
const { tsConfigPath, buildOptions } = wco ;
113
112
114
113
const loaders : any [ ] = [ NgToolsLoader ] ;
@@ -123,7 +122,7 @@ export function getAotConfig(wco: WebpackConfigOptions, extract = false) {
123
122
124
123
return {
125
124
module : { rules : [ { test, use : loaders } ] } ,
126
- plugins : [ _createAotPlugin ( wco , { tsConfigPath } , true , extract ) ]
125
+ plugins : [ _createAotPlugin ( wco , { tsConfigPath } , i18nExtract ) ]
127
126
} ;
128
127
}
129
128
0 commit comments