-1

I am new in requirejs .I don't have any knowledge about requireJs or other JS optimization techniques.

My requirement is , I have single page application developed in angularJs. Now the single page application will load all available Js for all modules.I need to reduce the number of loading js file(Need to load only needed js file for each module). What is the best method for this optimization. From my initial knowledge i only got the requireJS. Any other method availble for this.Please suggest the better method for JS loading optimization.

Team
  • 347
  • 1
  • 5
  • 16
  • What is the problem with requirejs? – timtos Jun 03 '15 at 13:06
  • I don't have any idea about requirejs and other optimization method. That's why I asked this question.I need to make sure that Requirejs is best for JS Optimization. I need to know about the drawbacks and advantages of using requirejs – Team Jun 03 '15 at 13:09

1 Answers1

1

I am doing all this with requirejs and for me it is working great. Files get loaded on demand, the release version gets minified, it is working smoothly with angular and more. Have a look at the topic RequireJS Optimizer and for automatization have a look at the grunt support: grunt-contrib-requirejs.

At the first link you can read:

RequireJS has an optimization tool that does the following

  • Combines related scripts together into build layers and minifies them via UglifyJS (the default) or Closure Compiler (an option when using Java).
  • Optimizes CSS by inlining CSS files referenced by @import and removing comments.
timtos
  • 2,225
  • 2
  • 27
  • 39
  • thanks, For your reply!!. Any other optimization techniques available for this – Team Jun 03 '15 at 13:29
  • Have a look at this stackoverflow question: http://stackoverflow.com/a/29181416/330802 - Here are some other names mentioned worth searching the internet for: Browserify, SystemJS and es6-module-loader. Unfortunately I don't have any personal experience with these. – timtos Jun 03 '15 at 13:37