Closed scopsy closed 7 years ago
I'm seeing this same behavior. Did you ever solve it, @scopsy?
@janiukjf I've added the AotPlugin to my webpack config plugins section(not the host replacement path):
new AotPlugin({
"mainPath": "main.ts",
"hostReplacementPaths": {
"environments/environment.ts": "environments/environment.prod.ts"
},
"exclude": [],
"tsConfigPath": "src/tsconfig.app.json",
"skipCodeGeneration": true
})
Thanks, @scopsy!
Oh, one more quick question, @scopsy. Where are you importing data.AotPlugin
from?
@janiukjf Oh sorry, that's just from our internal build system. simply import AotPlugin
from @ngtools/webpack
:)
@scopsy Awesome! Found it and it works. Thanks again!
@scopsy where do input the code? :D
@longhoang2984 Under the plugins array in the webpack config file.
When rendering a different environment i.e staging, the dist folder contains the code with the correct env data. but when rendering in the server it's compiled with development environment instead. any suggestions on how I can compiel webpack with the correct env ?