@@ -17,7 +17,7 @@ function _createAotPlugin(wco: WebpackConfigOptions, options: any) {
17
17
const { appConfig, projectRoot, buildOptions } = wco ;
18
18
19
19
// Read the environment, and set it in the compiler host.
20
- let hostOverrideFileSystem : any = { } ;
20
+ let hostReplacementPaths : any = { } ;
21
21
// process environment file replacement
22
22
if ( appConfig . environments ) {
23
23
if ( ! appConfig . environmentSource ) {
@@ -58,9 +58,10 @@ function _createAotPlugin(wco: WebpackConfigOptions, options: any) {
58
58
const appRoot = path . resolve ( projectRoot , appConfig . root ) ;
59
59
const sourcePath = appConfig . environmentSource ;
60
60
const envFile = appConfig . environments [ buildOptions . environment ] ;
61
- const environmentContent = fs . readFileSync ( path . join ( appRoot , envFile ) ) . toString ( ) ;
62
61
63
- hostOverrideFileSystem = { [ path . join ( appRoot , sourcePath ) ] : environmentContent } ;
62
+ hostReplacementPaths = {
63
+ [ path . join ( appRoot , sourcePath ) ] : path . join ( appRoot , envFile )
64
+ } ;
64
65
}
65
66
66
67
return new AotPlugin ( Object . assign ( { } , {
@@ -69,15 +70,18 @@ function _createAotPlugin(wco: WebpackConfigOptions, options: any) {
69
70
i18nFile : buildOptions . i18nFile ,
70
71
i18nFormat : buildOptions . i18nFormat ,
71
72
locale : buildOptions . locale ,
72
- hostOverrideFileSystem
73
+ hostReplacementPaths
73
74
} , options ) ) ;
74
75
}
75
76
76
77
77
78
export const getNonAotConfig = function ( wco : WebpackConfigOptions ) {
78
79
const { projectRoot, appConfig } = wco ;
79
80
let exclude = [ '**/*.spec.ts' ] ;
80
- if ( appConfig . test ) { exclude . push ( path . join ( projectRoot , appConfig . root , appConfig . test ) ) ; } ;
81
+ if ( appConfig . test ) {
82
+ exclude . push ( path . join ( projectRoot , appConfig . root , appConfig . test ) ) ;
83
+ }
84
+
81
85
return {
82
86
module : {
83
87
rules : [
0 commit comments