Angular-cli: AngularCompilerPlugin hostReplacementPaths option does not work

Created on 7 Aug 2018  路  4Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions

node: v9.2.1
npm: 6.3.0
ng: 6.1.2
macOS (High Sierra)

Repro steps

  • ng eject with ng-cli 1.7
  • update to Angular6.1.2
  • try to run webpack-devserver

Desired functionality

Mention any other details that might be useful

new AngularCompilerPlugin({
  ...
  hostReplacementPaths: {
    'environments/environment.ts': environmentFiles[NODE_ENV]
  },
  ...
})

does not replace the environment.ts file anymore.
because here it tries to normalize to absolute path and then comparing it with relative one - https://github.com/angular/angular-cli/blob/master/packages/ngtools/webpack/src/virtual_file_system_decorator.ts#L188

Here also question on SO - https://stackoverflow.com/questions/51676035/webpack-angularcompilerplugin-hostreplacementpaths-option-does-not-work

ngtoolwebpack low regression bufix

Most helpful comment

@stevermeister The bug was introduced moving from 6.1.0-rc.1 to 6.1.0-rc.2, probably with this commit: https://github.com/angular/angular-cli/commit/86a62adbe8faeb4628296d5d6915c54e6dbfd85b

I just downgraded to 6.1.0-rc.1 for the time being

All 4 comments

This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

@stevermeister The bug was introduced moving from 6.1.0-rc.1 to 6.1.0-rc.2, probably with this commit: https://github.com/angular/angular-cli/commit/86a62adbe8faeb4628296d5d6915c54e6dbfd85b

I just downgraded to 6.1.0-rc.1 for the time being

Same issue for me.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IngvarKofoed picture IngvarKofoed  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

ericel picture ericel  路  3Comments

naveedahmed1 picture naveedahmed1  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments