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.

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
sebastien.b
  • 1,049
  • 1
  • 14
  • 12

2 Answers2

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]
Kyle Finley
  • 11,842
  • 6
  • 43
  • 64
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.

Community
  • 1
  • 1
TimDog
  • 8,758
  • 5
  • 41
  • 50
  • 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". – sebastien.b Feb 04 '13 at 02:37