WebPack Question
Hi,
I'm not actually submitting an issue, it's more a question if you allow me.
We were using WebPack Starter and we were able to do the following in the index.html, so that this block of code will be removed during production build.
<% if (webpackConfig.metadata.ENV === 'development') { %>
//dev specific coding
<% } %>
I was wondering if there is any equivalent syntax in Angular CLI to do the same?
Thanks a lot!
JZ
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
The log given by the failure.
Normally this include a stack trace and some more information.
Mention any other details that might be useful.
Thanks! We'll be in touch soon.
@zwjohn for future reference this type of question may be better suited for the gitter channel. the cli does not have a templating syntax for index.html. However it does have a system for dealing with different environments. in angular-cli.json look at the environments object.
No, we don't have html templating in the CLI. The environments feature is the most similar one we have. https://github.com/angular/angular-cli/blob/master/docs/documentation/build.md#build-targets-and-environment-files
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.