4

Meteor 在开发服务器上使用单独的 CSS 和 JS 文件,并在生产服务器上合并和缩小它们。有没有办法强制它组合和缩小开发服务器(localhost)上的所有 JS/CSS,至少在部署之前检查组合文件是否正常工作?谢谢。

4

2 回答 2

19
> meteor run --production

meteor run现在有一个production标志:

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]
于 2013-03-02T17:25:06.297 回答
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.

于 2013-02-03T04:58:51.323 回答