Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor: Aggregate multiple javascript files into one?

Tags:

meteor

Drupal has an option to "aggregate" (that is, to combine) multiple js or css files into one, to reduce the number of files going over the network.

Does Meteor have something similar? Obviously for development it is nicer to have the files all separate. But on production it would be great to have them bundled (and minified).

like image 773
donquixote Avatar asked Jan 05 '13 15:01

donquixote


1 Answers

Yes.

Meteor uses separate files on the development server and combines and minifies js and css files on the production server.

For an example view the source of http://meteor.com.

As a bonus, Meteor has Smart Packages that compile various preprocessors, including:

  • LESS
  • Stylus
  • CoffeeScript

By using the Smart Packages preprocessors, you are free to write the code or styles in your preferred language and Meteor will convert it to javascript or css, on demand.

like image 85
Kyle Finley Avatar answered Nov 15 '22 10:11

Kyle Finley