Questions tagged [ngtools]

Angular Ahead-of-Time Webpack Plugin

Angular Ahead-of-Time Webpack Plugin

https://www.npmjs.com/package/@ngtools/webpack

14 questions
54
votes
4 answers

AOT - Angular 6 - Directive SomeComponent, Expected 0 arguments, but got 1. for self made Component

I am facing issue when i want to compile my current project in AOT with following package version : @ngtools/webpack@6.0.3 @angular@latest (6.0.2) Webpack@4.0.0 my webpack and tsconfig.json configuration can be find here I have facing some issue…
Yanis-git
  • 7,737
  • 3
  • 24
  • 41
9
votes
0 answers

--mode development Error: NormalModuleFactory.beforeResolve is no longer a waterfall hook

I use webpack 5 and @ngtools/webpack together to build angular application. when i run webpack --mode development following errors appear: Error: NormalModuleFactory.beforeResolve is no longer a waterfall hook, but a bailing hook instead. Do not…
5
votes
3 answers

ERROR in Must have a source file to refactor

Strange error with webpack compilation: ERROR in Must have a source file to refactor. Looking at the source code I found this message in ./node_modules/@ngtools/refactor.js: ... if (!sourceFile) { throw new Error('Must have a source file to…
Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176
4
votes
1 answer

Can @ngtools/webpack AngularWebpackPlugin link partially compiled ivy libraries?

I've got this somewhat old Angular web application which was updated from Angular 6 to Angular 12, however, Angular CLI is not being used for building it, instead it relies on Webpack 5, its loaders and AngularWebpackPlugin from…
D. Joe
  • 55
  • 1
  • 5
3
votes
0 answers

Angular 6 - AOT compilation on library to be used as lazily loaded plugin in the main application

I am working on a plugin-based application done in Angular 6. I have 2 projects, a main project and a lib project where i develop the plugins. The plugins get builded with ng build --prod into UMD and then loaded using SystemJs into the main app,…
IvanSt
  • 360
  • 4
  • 17
3
votes
2 answers

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({ ... …
Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176
2
votes
0 answers

ngtools module buildable after migration to Angular 14

I have upgraded my Angular 12 project to Angular 13 without any problems but then when I wanted to pass from angular 13 to Angular 14 I encountered problems with @ngtools. Complete log here: ./src/main.ts - Error: Module build failed (from…
LaCodeM
  • 645
  • 7
  • 23
1
vote
1 answer

Angular @ngtools/webpack build fails when using webpack mode 'production'

I've been having the issue, that as soon as I set { mode: 'production' } in my webpack.config.js my Angular templates that have been declared using @Component({ templateUrl: 'path/to/template.html' }) could not longer be compiled. The resulting…
Link64
  • 718
  • 4
  • 20
1
vote
1 answer

@ngtools/webpack does not build by entrypoint imports

I use @ngtools/webpack directly in angular-app (withou angular-cli) and i got unexpected behavior. Aot plugin build all ts-files in project, but some files not imported by entrypoint file (main.ts). For expample - ts-loader build only files that…
Alxpsr
  • 138
  • 10
0
votes
1 answer

Webpack:is missing from the TypeScript compilation. ...at AngularCompilerPlugin.getCompiledFile

I am using angular 10.1.0-next.4 in web application with "@ngtools/webpack": "^10.0.0", "webpack": "^4.43.0", and getting error while doing build. PS D:\app2020\testing\local\angular10\sampleangular10app\myangular10app> ng run…
cj devin
  • 1,045
  • 3
  • 13
  • 48
0
votes
1 answer

@ngtools/webpack not compiling project code after migrating from Angular4 to Angular7

I migrated angular4 application to Angular7 and resolved the dev and prod builds but AOT build is not transpiling the application code(app.module). The main and polyfill bundle size is only 1 kb each. looking at the output console it seems it is not…
Pradeep
  • 19
  • 5
0
votes
0 answers

Reduce Logging from @ngtools/webpack

I'd like to reduce the amount of logging being generated when running a production AoT Angular build with @ngtools/webpack. Currently, it's generating a many MB-big log full of "Resolving module" text. Is there any option I am missing for disabling…
FreakyFred
  • 11
  • 1
0
votes
1 answer

Angular with Ivy + webpack - bundles larger than before

I've upgraded to Angular 8.0 while opting in to "Ivy". Everything is compiling OK but results have been disappointing in terms of bundle sizes. Actually, my vendor bundle with Angular has increased in size vs ng7. Not configured right? I'm using…
vidalsasoon
  • 4,365
  • 1
  • 32
  • 40
0
votes
1 answer

@ngtools/webpack: Angular Compiler was detected but it was an instance of the wrong class.

I already spent about 10 hours around this error: ERROR in ./src/main.ts Module build failed: Error: Angular Compiler was detected but it was an instance of the wrong class. This likely means you have several @ngtools/webpack packages installed. You…
profimedica
  • 2,716
  • 31
  • 41