ng-build

Improving production build time for Angular 7 application

折月煮酒 提交于 2019-11-29 17:54:28
问题 My application takes a very long time to build for production using ng build --prod Sometimes it even fails with FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory Is there something I can do to reduce the build time? 回答1: There are some things that can be done to reduce the build time. Increase the memory limit of the build process The build command is executed by node where a single process has a maximum memory limit of 1.76 GB on 64bit

ng build --prod is not generating vendor.bundle.js

冷暖自知 提交于 2019-11-29 06:56:14
I am using node version 8.9.4, npm version 5.6.0 I have no clue why this is happening the ng build --dev is generating vendor.bundle.js while ng build --prod is not generating vendor.bundle.js here is the screenshot output with ng build--prod [ [output with ng-build --dev] Here is my package.json `{ "name": "app1", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular-devkit/core": "0.0.28", "@angular/animations": "^5.0.0", "@angular

Use process.env in Angular 5 environment

隐身守侯 提交于 2019-11-29 03:35:26
I try to build an Angular 5 application with the standard ng build --prod command, and I want to set the basic API-Url in the environment.prod.ts to a value dependent on my process.env variables. This is my file: export const environment = { production: true, apiUrl: `${process.env.BASE_URL}` || 'http://localhost:8070/', }; But when I try to build the application the following error occurs: ERROR in src/environments/environment.ts(7,16): error TS2304: Cannot find name 'process'. How can I set my API-Url according to an env variable when building the application? You won't have access to

ng build --prod is not generating vendor.bundle.js

你说的曾经没有我的故事 提交于 2019-11-27 23:52:51
问题 I am using node version 8.9.4, npm version 5.6.0 I have no clue why this is happening the ng build --dev is generating vendor.bundle.js while ng build --prod is not generating vendor.bundle.js here is the screenshot output with ng build--prod [ [output with ng-build --dev] Here is my package.json `{ "name": "app1", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private":

Use process.env in Angular 5 environment

巧了我就是萌 提交于 2019-11-27 03:12:20
问题 I try to build an Angular 5 application with the standard ng build --prod command, and I want to set the basic API-Url in the environment.prod.ts to a value dependent on my process.env variables. This is my file: export const environment = { production: true, apiUrl: `${process.env.BASE_URL}` || 'http://localhost:8070/', }; But when I try to build the application the following error occurs: ERROR in src/environments/environment.ts(7,16): error TS2304: Cannot find name 'process'. How can I set