Comments (4)
How to do the equivalent of this?:
node --max-old-space-size=8192 node_modules/@angular/compiler-cli/src/main.js -p tsconfig-aot.json
from ngc-webpack.
Sadly, the above solution won't work for everyone. The memory consumption is obscene to say the least. I've even gone as far as:
node --max_old_space_size=8192 --optimize_for_size --max_executable_size=8192 --stack_size=8192 /usr/local/bin/npm run build
What we need is what Google is using internally and we need it yesterday! angular/angular#12184 (comment)
from ngc-webpack.
The plugin essentially move things from there to there, the core functionality is in the angular compiler.
Can you please give more details on the setup and project, maybe something to reproduce
from ngc-webpack.
Have a medium sized app with about 5 lazy-loaded modules and 78 defined components and maybe about 10 forms. It has been stuck on 2.1.1 in JiT mode largely due to depending on the earlier version of Angular Universal.
So have recently been porting it to 4.1.X and AoT using the new Angular Universal project. In this process I have also been seeing the exact same error thrown.
I believe it to be an optimization issue with the angular compiler. Specifically one issue on the angular repo, angular/angular#12184, eventually starts to discuss that the compiler can sometimes use a whole lot of memory, core members chiming in.
The only other one I've seen to actually pin-point a specific possible cause other than "big projects => bad" has to do with the number of form controls in your app 20-30 being bad: angular/angular#11458. It however derails a bit and got locked. Nevertheless it would at least apply to our project, in particular it seems that it is our lazy loaded modules which explode, which is also where all of our forms are. To be specific we use the ReactiveFormModule and not the template-based form module.
The only actionable solution I've found is the one mentioned by @dereklin, allow node to use more RAM. Discussed more in depth in angular/angular#5229 and previously linked issue angular/angular#12184.
Translating the above solution to a gulp project should be to run gulp through node, i.e.:
node --max_old_space_size=4000 node_modules/gulp/bin/gulp.js [<task>]
If you run webpack through the CLI using npm scripts, like almost all starters I've seen, I imagine it'd be something similar for webpack.
So I derailed a lot but think the only real change that can be done in this project would be to add a note of this workaround in the README.md as this needs to be optimized downstream at the angular compiler, as noted by Tobias Bosch in angular/angular#12184 (comment).
from ngc-webpack.
Related Issues (20)
- Missing assets HOT 1
- Error "callback(): The callback was already called" when building with the new cleanup loader HOT 12
- breaks webpack-dll-bundles-plugin HOT 1
- Add missing any to parameter in plugin.d.ts
- AOT build with angular i18n
- Cannot set property 'disable' of undefined (tsconfig inheritance)
- Plugin doesn't work with angular 5.0.0-rc.0 HOT 23
- Angular 5.0.0.rc6 HOT 7
- Angular 5 Issue HOT 2
- 4.1.0 missing ngc-webpack/src/cli.js HOT 1
- Loader typescript chain in AOT ? HOT 2
- js, .d.ts and metadata file not generated
- Watch mode simply doesn't work with 3.x?
- Missing tsickle depedency
- Lint only
- Change log docs?
- 'Must specify "tsConfigPath" in the configuration of @ngtools/webpack.' HOT 1
- ngc version 3 work with webpack 4 HOT 1
- Error: The "@ngtools/webpack" package installed is not compatible with this version of "ngc-webpack" HOT 9
- Angular 7 ngc-webpack HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngc-webpack.