Skip to content

AngularCompilerPlugin doesn't take input from previous loaders #9559

@Necroskillz

Description

@Necroskillz

Versions

"@ngtools/webpack": "^1.9.8"

Repro steps

  • Have multiple loaders in webpack.config that are executed before @ngtools/webpack. e.g.
{
   test: /\.ts$/,
   loader: ['@ngtools/webpack', 'ts-nameof-loader']
}
  • Use AngularCompilerPlugin.
new AngularCompilerPlugin({
     tsConfigPath: 'app/tsconfig.json',
     mainPath: helpers.root('app/main.ts'),
     skipCodeGeneration: false
})
  • Run webpack

Observed behavior

The loaders before @ngtools/webpack are executed, but sinse AngularCompilerPlugin ignores the source parameter that was passed in, and instead loads the content directly from the file, any preprocessing done by previous loaders is ignored. The AotPlugin has some special handling for this case.

Desired behavior

Input from loaders that are executed before @ngtools/webpack is considered.

Mention any other details that might be useful (optional)

Maybe I'm missing something, and this scenario is not supposed to supported. But it worked before and we have some code depending on this. If that's the case, please let me know if there any supported way to have this working.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions