amdev amdev - 1 year ago 121
AngularJS Question

How to build the yeoman "angular-generator" app in production?

I created my angular application with "yeoman" using "yo angular" with grunt sass bootstrap.

But with node_mudules bower_component and all dev feature the empty project is 200mo sized

How can I build my application for production, include minify css/js and keep only used and required dependance.


I don't understand the -1, thousand people use the angular-generator from yeoman and I can't find a build tutorial for this specific generator.

npm run build
result is no build script found ( of course is what i need )

grunt build
seems to work but the website is not displaying well.

grunt serve:dist
build and run on serve but same problem as
grunt build

The dev application ( it s just
yo angular
empty project )

grunt serve
, it works and i can navigate

enter image description here

grunt serve:dist
, it doesn't work and i can't navigate, it seems like "bower_components" are not build well

enter image description here

enter image description here

Answer Source

if you are using grunt do: grunt build for gulp is gulp build, after the build you will get a dist folder, everything inside is you production app included minify css/js, you don't need anymore.

You do not need to deploy everything from your project folder. Hope it help.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download