My node memory is around 2gb while using nx serve app or ng serve
how can i reduce the memory use and speed up during development time ?
i tried to disable the source map but i dont see any changes in memory or in files while open chrome dev tools for example ( resource 14Mb)
following conf does not work :
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "app:build:production"
},
"development": {
"browserTarget": "app:build:development"
}
},
"defaultConfiguration": "development",
"options": {
"port": 4200,
"sourceMap":{
"scripts": false,
"styles": false,
"vendor": false
}
},
"build": {
"builder": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/app",
"index": "apps/app/src/index.html",
"main": "apps/app/src/main.ts",
"polyfills": "apps/app/src/polyfills.ts",
"tsConfig": "apps/app/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
],
"styles": ["apps/app/src/styles.scss"],
"stylePreprocessorOptions": {
"includePaths": ["libs/styles", "apps/app/src/assets/scss"]
},
"scripts": []
},
"configurations": {
"development": {
"buildOptimizer": false,
"optimization": true,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": false,
"namedChunks": true
}
}
You can reduce the startup time of angular build & ng serve by using this package
# install globally
npm i -g ngc-esbuild
# or locally
npm i ngc-esbuild
and then add a command the package.json's scripts according to this,
"scripts": {
"esbuild": "ngc-esbuild --minify true --sourcemap false --port 6500 --open"
}
Now run it via npm run esbuild, it will startup your angular app within 1s second or less.