What makes a lie in aot build angular cli - Memory issue

What "false"to do in a ng build --prod --aot falseteam

I am working on an angular 4 application developed using ng cli, as it is a corporate solution, the application becomes so huge that it takes too much time to maintain and build. I even had memory problems from javascript and I started using the following command to create an application

ng build --prod --aot false

But I'm not sure how this works.

+2
source share
2 answers

All available commands for angular-cli can be found here .

Now, when we launch ng build --prod, it means that we specify target for our application:

{
    name: 'target',
    type: String,
    default: 'development',
    aliases: ['t', { 'dev': 'development' }, { 'prod': 'production' }],
    description: 'Defines the build target.'
},

angular -cli (angular -cli@1.4.x) :

// Fill in defaults for build targets
public addTargetDefaults(buildOptions: T): T {
  const targetDefaults: { [target: string]: Partial<BuildOptions> } = {
    development: {
      environment: 'dev',
      outputHashing: 'media',
      sourcemaps: true,
      extractCss: false,
      namedChunks: true,
      aot: false
    },
    production: {
      environment: 'prod',
      outputHashing: 'all',
      sourcemaps: false,
      extractCss: true,
      namedChunks: false,
      aot: true
    }
  };

docs

--aot false, aot. , false.

aot-, , , :

package.json

"scripts": {
  "prod": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --prod" 
}

, , , aot.

+4

AOT true , , :

ng build prod --no-aot 

ng build prod --aot=false

AOT js ,

+3

Source: https://habr.com/ru/post/1688230/


All Articles