0

I am working on a project in angularJs and I am unable to think of a way in which I minifiy a file during rendering. Is there any way in javascript or angular ? Please help I am a newbie

1 Answer 1

1

you have to minimify before, for this you can use plenty of tools online :

https://jscompress.com/

https://javascript-minifier.com/

Use js minimify tool directly with node js :

https://github.com/mishoo/UglifyJS2

Use a task runner like gulp or grunt with minimify plugin:

http://gruntjs.com/

http://gulpjs.com/

or use webpack to bundle and minimify your website or application:

https://webpack.github.io/docs/

Sign up to request clarification or add additional context in comments.

4 Comments

is there any other way apart from online tools ?
All brilliant tools! If you need something with an interface, you can download Koala.
yeah uglify2 is pretty good, you just have to install node&npm install uglify with 'npm install uglify-js -g' and then just do in a terminal 'uglifyjs yourFilePath' see the doc in my answer
Then use webpack, gulp, grunt, brocoli or other tool. They create automatic tasks that run with a single command line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.