Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
718 views
in Technique[技术] by (71.8m points)

angularjs - can grunt server use for production application deployment

i am at fresher level,i want to know about the Grunt server is able to handle production application deployment.

.. please help me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes you can run grunt in production, You can see this post for how to do it.

What's the purpose of gruntjs server task?

But, i woudn't recommend that.

Grunt server is basically designed to help the developer to run your app, without using an actual server. Apart from serving pages, It does some tasks like compiling sass, less files and reloading the page using live-reload, etc,. whenever you change these files and any additional tasks based on the config you provide in Gruntfile.js

But in a production server, you might expect a lot of traffic and every time files changes recompiling the files and all is lot of mess. I don't think Grunt server can handle the traffic in production and all the tasks, your site may become very slow.

Also Angular is front-end framework, so how do you plan to use any web services with it? To run web services you might be running Apache or node server. so you can deploy your app build in the same server.

You can do all these in your development and you build the app and place it in production site

You can use Grunt Build command to build your angular app and it will give minified javascript, css and other things in dist folder

You can deploy this minified app in your production server. very less code is transfered to the client so you can reduce lot of bandwidth stress on the server and your application will be faster.

Choose Wisely :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...