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

Using @ngtools/webpack with ContextReplacementPlugin plugin does not create lazy routes chunks

Open artaommahe opened this issue 9 years ago • 21 comments

OS?

Ubuntu 16.04

Versions.

@ngtools/webpack - 1.2.7

Repro steps.

  • create simple webpack config with @ngtools/webpack usage and app with lazy routes (e.g. this example repo https://github.com/daniele-zurico/webpack-aot)
  • add to webpack config plugins ContextReplacementPlugin usage like so
plugins: [
  new webpack.ContextReplacementPlugin(
    /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
    __dirname
  ),
  • run build npm run build
  • no chunks for lazy routes in dist folder
  • comment out ContextReplacementPlugin in plugins, build, chunks created

Mention any other details that might be useful.

this check never passes with ContextReplacementPlugin usage https://github.com/angular/angular-cli/blob/29b134d7018c7d4e2eed74715b30b28e56fdcd49/packages/%40ngtools/webpack/src/plugin.ts#L247

@hansl

artaommahe avatar Feb 04 '17 12:02 artaommahe

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.