Meteor uses separate CSS and JS files on the development server and combines and minifies them on the production server. Is there a way to force it to combine and minify all JS/CSS on the development server (localhost), at least to check if the combined file works fine before deploying? Thanks.
2 Answers
> meteor run --production
meteor run now has a production flag:
Usage: meteor run [options]
Options:
--port, -p Port to listen on. NOTE: Also uses port N+1 and N+2. [default: 3000]
--production Run in production mode. Minify and bundle CSS and JS files. [boolean]
1 Comment
Vadorequest
Impressive. The quality of the minification is impressive.
Presently, no. You can meteor deploy --debug to leave the files unminified in production, but there is no 'combine but don't minify' command within meteor at this time.
Per the docs:
You can deploy in debug mode by passing --debug. This will leave your source code readable by your favorite in-browser debugger, just like it is in local development mode.
If you simply want to combine multiple javascript files into one, here are some ideas.
1 Comment
sebastien.b
Thanks. Sorry, my question wasn't precise enough. I want to combine and minify. What I mean is that I want to be able to test the production behavior locally, with all the files minified/combined as if it had been the case on the production server. There's got to be a special flag that is passed when meteor deploy is called that tells meteor: "hey, you are in production mode".