angular-seed icon indicating copy to clipboard operation
angular-seed copied to clipboard

Compiled env.config.js

Open brian428 opened this issue 7 years ago • 1 comments

Minko, I ran into an issue where the env.config.ts is being compiled into JS, and when a dev reload happens, the ENV_CONFIG value stops getting replaced. Or more specifically, the compiled JS version without the replacement seems to be getting copied over to /dist during the asset copy. So an error is thrown since JSON.parse('<%= ENV_CONFIG %>'); is invalid.

I found an older issue #1747 which seems to be the same problem. In order to solve it, I had to modify build.assets.dev.ts to add:

'!' + join(Config.APP_SRC, '**', 'env.config.js'),
'!' + join(Config.APP_SRC, '**', 'env.config.js.map'),

I'm not sure why this suddenly started being a problem, but I thought I would mention it again in case the additional exclusions are something you want to include in the seed.

brian428 avatar Feb 20 '18 16:02 brian428

To add: just to be safe, I also added the new exclusions to build.assets.prod.ts.

brian428 avatar Feb 20 '18 16:02 brian428