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.