Awesome
Meteor-minifiers
The goal of this Meteor package is to remove the unnecessary code sent to a Meteor client.
It works in two steps :
- Replace
Meteor.isClient
bytrue
andMeteor.isServer
byfalse
on files sent to the client. We use grasp for that purpose. - Use uglifyjs to remove unnecessary code.
With this package the following piece of code :
if (Meteor.isClient) {
doSomethingOnTheClient();
}
if (Meteor.isServer) {
doSomethingOnTheServer();
}
if (Meteor.isClient && Meteor.userId()) {
console.log('User is connected');
}
became on the client:
doSomethingOnTheClient();
if (Meteor.userId()) {
console.log('User is connected');
}
This is a behavior that a lot of newcomers expect.
Installation
- Download the package from github and put in your
./packages/
directory - Rename it
minifiers
in order to overwrite the build-in minifiers package
Links
- See the discussion on
meteor-talk
: https://groups.google.com/forum/#!topic/meteor-talk/iHat47f6iGE - See the grasp library