4

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 2

19
> 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]
Sign up to request clarification or add additional context in comments.

1 Comment

Impressive. The quality of the minification is impressive.
0

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

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

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.