Open BAZINGAyi opened 5 years ago
thats strange, my final release size is about 17mb using nebular 7, when i was with nebular 4, was 14mb, are you sure that you don't have any extra files?
thats strange, my final release size is about 17mb using nebular 7, when i was with nebular 4, was 14mb, are you sure that you don't have any extra files?
I believe you're talking about Angular 7 & Angular 4 instead of Nebular. Regardless, I can confirm that the file size is 17MB using npm run build:prod
thats strange, my final release size is about 17mb using nebular 7, when i was with nebular 4, was 14mb, are you sure that you don't have any extra files?
I believe you're talking about Angular 7 & Angular 4 instead of Nebular. Regardless, I can confirm that the file size is 17MB using
npm run build:prod
No, when i was using version 4 of NgxAdmin, i use it since version 4
No, when i was using version 4 of NgxAdmin, i use it since version 4
Current ngx-admin
version is 3.0.0. There's no version 4 yet.
No, when i was using version 4 of NgxAdmin, i use it since version 4
Current
ngx-admin
version is 3.0.0. There's no version 4 yet.
Yeah, you are right, anyway, since that version, lol
@andredatsch, @biborn.
Thanks, everyone.
It reduces the size of dist dictionary By using npm run build:prod
.
But I still have a question about that, how to remove useless module. For example, Need I remove moudle name in package.json? I just want to reduce my project size? What is the good way?
Gus
@andredatsch, @biborn.
Thanks, everyone.
It reduces the size of dist dictionary By using
npm run build:prod
.But I still have a question about that, how to remove useless module. For example, Need I remove moudle name in package.json? I just want to reduce my project size? What is the good way?
Gus
Every package in package.json
is a dependency for the project, removing them might cause unexpected result. It is better to leave it alone, unless you're really sure you're not using them in your code.
Another good way to reduce the dist
size is by using SVG image instead of PNG or JPG. Check for large image size in your project and substitute them with SVG file if possible, or compress the image using tinypng or other tools you're familiar with.
@andredatsch, @biborn. Thanks, everyone. It reduces the size of dist dictionary By using
npm run build:prod
. But I still have a question about that, how to remove useless module. For example, Need I remove moudle name in package.json? I just want to reduce my project size? What is the good way? GusEvery package in
package.json
is a dependency for the project, removing them might cause unexpected result. It is better to leave it alone, unless you're really sure you're not using them in your code.Another good way to reduce the
dist
size is by using SVG image instead of PNG or JPG. Check for large image size in your project and substitute them with SVG file if possible, or compress the image using tinypng or other tools you're familiar with.
Thx your repley, I will try.
Best regards!
Gus
@BAZINGAyi what are bundle sizes like now?
ngx-admin is building es5 and es2015 javascript files for browser compatibility you can generate only es5 javascript build by changing "target": "es5", in the tsconfig.json file . Surely es5 has browser compatibility almost 100% https://kangax.github.io/compat-table/es5/ as compared to es2015 https://kangax.github.io/compat-table/es6/ .
tsconfig.json file
{ "compileOnSave": false, "compilerOptions": { "importHelpers": true, "module": "esnext", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ "es2017", "dom" ], "plugins": [ { "name": "tslint-language-service"} ] } }
Reduces Build size from 18MB to 11MB
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior: I used ngx-admin as framework, but i found complie project is too slow and are too moudles in there. The size of dist maybe are 70M After using
ng build
. I want to know how to optimize it.Thx. Wish your response.
Other information:
npm, node, OS, Browser
Angular, Nebular