5

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).

1
  • I had the same question. Thanks for asking it for me! =) Commented Dec 7, 2014 at 20:13

1 Answer 1

8

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:

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.

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

10 Comments

+1. As a rule, local development should always use "full" javascript libraries (no need to explicitly source .min.js files locally as the deploy process minifies automatically).
@Kyle: Cool! Does the same apply to less/css?
@donquixote the current LESS Smart Package converts the LESS to CSS before serving it to the browser. So, unfortunately, you will not see the LESS un-compiled when developing. With Meteor's AutoReload feature this isn't much of a problem, though, because the page will reload on file changes.
@TimDog, couldn't agree more. Keeping the files separate really speeds up bug hunting.
@Kyle: Sure. My intended question was whether it can be minified and combined into one file, like the js. Looking at the Meteor.com source, this indeed seems to be the case. And just now I notice that this is already answered in your reply :)
|

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.