Tuesday, 7 August 2018

webpack AngularCompilerPlugin hostReplacementPaths option does not work

After I've updated to Angular6 and updated @ngtools/webpack from "6.0.0-beta.8" to "6.1.2" I found that hostReplacementPaths option does not work anymore.

Normally it replaces correct env files:

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

But now it does not.

I made deep debug into @ngtools/webpack and found that normalize function here https://github.com/angular/angular-cli/blob/master/packages/ngtools/webpack/src/virtual_file_system_decorator.ts#L188 does not work

this one https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/core/src/virtual-fs/path.ts#L199

still could not find what went wrong with it. maybe somebody already solved this issue?

Created an issue in angular-cli repo - https://github.com/angular/angular-cli/issues/11801



from webpack AngularCompilerPlugin hostReplacementPaths option does not work

No comments:

Post a Comment