Meteor.js如何摆脱那些JS包含的?

时间:2017-01-12 08:08:14

标签: javascript meteor optimization

我是meteor.js的初学者,所以知道我正在尝试优化流星应用。 我注意到页面中有很多包含。 谁知道如何摆脱它们?

这里是:

  <script type="text/javascript">__meteor_runtime_config__ = JSON.parse(decodeURIComponent("%7B%22meteorRelease%22%3A%22METEOR%401.4.2.3%22%2C%22meteorEnv%22%3A%7B%22NODE_ENV%22%3A%22development%22%2C%22TEST_METADATA%22%3A%22%7B%7D%22%7D%2C%22PUBLIC_SETTINGS%22%3A%7B%7D%2C%22ROOT_URL%22%3A%22http%3A%2F%2Flocalhost%3A3000%2F%22%2C%22ROOT_URL_PATH_PREFIX%22%3A%22%22%2C%22appId%22%3A%223lv5c21c0ikr9qpyaa9%22%2C%22autoupdateVersion%22%3A%22e07242d68a165ae640e730c0dd787691b4268550%22%2C%22autoupdateVersionRefreshable%22%3A%22f4f9f237151a8c4325bd029b5e7eceb5b2797974%22%2C%22autoupdateVersionCordova%22%3A%22none%22%7D"));</script>
  <script type="text/javascript" src="/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c"></script>
  <script type="text/javascript" src="/packages/meteor.js?hash=e3f53db3be730057fed1a5f709ecd5fc7cae1229"></script>
  <script type="text/javascript" src="/packages/meteor-base.js?hash=a4d07a6b394e56bbe6ccc773c95e7cdb3434960d"></script>
  <script type="text/javascript" src="/packages/mobile-experience.js?hash=8ded3e69a3e367f321ab9a2b52e3ecdd2661a365"></script>
  <script type="text/javascript" src="/packages/modules-runtime.js?hash=637cb12b6fd3acf3ffbfcf0f2ee1cf3988a7f1fe"></script>
  <script type="text/javascript" src="/packages/modules.js?hash=fff25e49208022bdf509af1c4e5fade57e29f302"></script>
  <script type="text/javascript" src="/packages/es5-shim.js?hash=adc3c6270d5697523fe2a72e73428390b7eba83a"></script>
  <script type="text/javascript" src="/packages/promise.js?hash=33f3b940f94952cb3a44d500099467511da0b575"></script>
  <script type="text/javascript" src="/packages/ecmascript-runtime.js?hash=d0c1e87c070810a617a5853c970ab05284650255"></script>
  <script type="text/javascript" src="/packages/babel-compiler.js?hash=a9546d4e245cfe40b406e08d40bf106241f01683"></script>
  <script type="text/javascript" src="/packages/ecmascript.js?hash=370a8752194bcf73be7fffa3635715d0fbf7853d"></script>
  <script type="text/javascript" src="/packages/base64.js?hash=0053489bb30bb5c0e3545df151f83e41150344b0"></script>
  <script type="text/javascript" src="/packages/ejson.js?hash=0f17ced99d522d48cd8f8b2139167fd06babd969"></script>
  <script type="text/javascript" src="/packages/id-map.js?hash=c7aea8dfa2bf46ff2ae0aa6c6cf09e36abc61d07"></script>
  <script type="text/javascript" src="/packages/ordered-dict.js?hash=bacdd1852075630a01f7de783e5e8e8aa8541cdc"></script>
  <script type="text/javascript" src="/packages/tracker.js?hash=9f8a0cec09c662aad5a5e224447b2d4e88d011ef"></script>
  <script type="text/javascript" src="/packages/babel-runtime.js?hash=cd7adc00903a7005bb7fbad73ca0c3986be427d1"></script>
  <script type="text/javascript" src="/packages/random.js?hash=31dadb9d3427506dd30dc50f5c898837e69e739b"></script>
  <script type="text/javascript" src="/packages/mongo-id.js?hash=345d169d517353f8146292b4abd24061721f8b26"></script>
  <script type="text/javascript" src="/packages/diff-sequence.js?hash=15014d7b1e11c05111a386992e684ab1d3cc4158"></script>
  <script type="text/javascript" src="/packages/geojson-utils.js?hash=b204c7d4caf119e6883522fb87c6cce060724bf0"></script>
  <script type="text/javascript" src="/packages/minimongo.js?hash=66cc6ab213289f154f49d61566dba8ff9dfc33b2"></script>
  <script type="text/javascript" src="/packages/check.js?hash=63d7478b74cadc04d378bc2266ea8bd1bf6849d8"></script>
  <script type="text/javascript" src="/packages/retry.js?hash=1e409617b538ff3e2b0238b15e45b3380c51a224"></script>
  <script type="text/javascript" src="/packages/ddp-common.js?hash=d42359bcace6c66ac90e2782193494253ee68155"></script>
  <script type="text/javascript" src="/packages/reload.js?hash=628b069673bffbc7390ba84ece8809c8c88c2eed"></script>
  <script type="text/javascript" src="/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379"></script>
  <script type="text/javascript" src="/packages/ddp.js?hash=25dc3f428447c81620c91c4245dbc6e4f7d32fb7"></script>
  <script type="text/javascript" src="/packages/ddp-server.js?hash=1beefbc7bd033ea687e7ab8fbd5694df072662af"></script>
  <script type="text/javascript" src="/packages/allow-deny.js?hash=c9344ef36901e05cbb58a8485e17433dac946bdc"></script>
  <script type="text/javascript" src="/packages/mongo.js?hash=c4281c0ff989ebee020f59f5a7b0735053cea5f7"></script>
  <script type="text/javascript" src="/packages/blaze-html-templates.js?hash=6e8335ce66460e45f00da73c7497654c5e26e236"></script>
  <script type="text/javascript" src="/packages/reactive-var.js?hash=ec712fa3ae588c4a1e7017f0bb4507c725391225"></script>
  <script type="text/javascript" src="/packages/jquery.js?hash=c57b3cfa0ca9c66400d4456b6f6f1e486ee10aad"></script>
  <script type="text/javascript" src="/packages/standard-minifier-css.js?hash=cfe82682f4394d3ffc6335555c1f9f3f73294507"></script>
  <script type="text/javascript" src="/packages/standard-minifier-js.js?hash=041bab58c8a89172eaab795deb5d96e38b64ec37"></script>
  <script type="text/javascript" src="/packages/shell-server.js?hash=6ff1313e4bf7618e577eb2604a580b2ea9b7631f"></script>
  <script type="text/javascript" src="/packages/deps.js?hash=7313f5a2685c6c2c673c78c15c8ce86ff59ab0c9"></script>
  <script type="text/javascript" src="/packages/observe-sequence.js?hash=7657a09b18583bf0e90cc7b86aa029572767a87f"></script>
  <script type="text/javascript" src="/packages/htmljs.js?hash=1ac878018eee6c53ed1375dc7ee75fc6865666ae"></script>
  <script type="text/javascript" src="/packages/blaze.js?hash=9d08dd7dde99958947679827a947134cdf2e4f12"></script>
  <script type="text/javascript" src="/packages/ui.js?hash=039c55a98376abd03d9d8cd4100895861b897643"></script>
  <script type="text/javascript" src="/packages/spacebars.js?hash=ebf9381e7fc625d41acb0df14995b7614360858a"></script>
  <script type="text/javascript" src="/packages/templating-compiler.js?hash=a71883cdec50e95ca135291415990753ed6d57fc"></script>
  <script type="text/javascript" src="/packages/templating-runtime.js?hash=c18de19afda6e9f0db7faf3d4382a4c953cabe18"></script>
  <script type="text/javascript" src="/packages/templating.js?hash=c2cf38de06efb47f67affb2dff9320e5eef33893"></script>
  <script type="text/javascript" src="/packages/iron_core.js?hash=eb27a7eaa0318536b619a36fbd2c9d45cd833bc9"></script>
  <script type="text/javascript" src="/packages/iron_dynamic-template.js?hash=7644dc7260de827ef1e361a75159fcc8af9fc074"></script>
  <script type="text/javascript" src="/packages/iron_layout.js?hash=b2030df3beb941a1eb0eeaf4d68c7f4c145ec14a"></script>
  <script type="text/javascript" src="/packages/iron_url.js?hash=ef0d02430901394d674ecc46d12f8d3c557e31c0"></script>
  <script type="text/javascript" src="/packages/iron_middleware-stack.js?hash=e5ffae14128fa7f2aa1e3c04bb343146e1dfec09"></script>
  <script type="text/javascript" src="/packages/iron_location.js?hash=1a6ee647a94fae1d34d1b5074ec4dfebfe6f1bd3"></script>
  <script type="text/javascript" src="/packages/reactive-dict.js?hash=6e313616fd3cbca06ed28d63ffd0164d2a78d804"></script>
  <script type="text/javascript" src="/packages/iron_controller.js?hash=eb63ea93809dcd3a8f40ad258e0997969a4d3ebc"></script>
  <script type="text/javascript" src="/packages/iron_router.js?hash=017cbcf91efe3e433391e5dcfa2f6ae06a124b46"></script>
  <script type="text/javascript" src="/packages/sacha_spin.js?hash=ddf0981d5d15b5595b1d93642b2710ed3b1c7763"></script>
  <script type="text/javascript" src="/packages/stylus.js?hash=dcbbc27dc6329f453854e5b19bd0f8aefa82fb05"></script>
  <script type="text/javascript" src="/packages/session.js?hash=821b0746e602b3be69538d299d6866e222121b54"></script>
  <script type="text/javascript" src="/packages/twbs_bootstrap.js?hash=2ee228e6c80c1d9a4b1e67e10006f8a5a425ddda"></script>
  <script type="text/javascript" src="/packages/ddp-rate-limiter.js?hash=457af847f89d207a6ca630c56f06d2a3af3a414c"></script>
  <script type="text/javascript" src="/packages/localstorage.js?hash=0e2106503b232ac80073b6e8ef206e988c5aca5b"></script>
  <script type="text/javascript" src="/packages/callback-hook.js?hash=e15ed8aa52e7c647efd9f4854e8a0fe4e40808fc"></script>
  <script type="text/javascript" src="/packages/accounts-base.js?hash=dfba72beacc01e72b0f8fb3d7770c95ac774f2b8"></script>
  <script type="text/javascript" src="/packages/anti_i18n.js?hash=8960dc7613ff1467b213e4ed2dec27fb491d232b"></script>
  <script type="text/javascript" src="/packages/sha.js?hash=04013281f0c21857cac3458d88a0dd86b20109ba"></script>
  <script type="text/javascript" src="/packages/srp.js?hash=85fa5b3bc1440273f8fa5125df5443c09f337567"></script>
  <script type="text/javascript" src="/packages/accounts-password.js?hash=6d4e41828e1dfcc45ff74267779a4e5ecdcd9eda"></script>
  <script type="text/javascript" src="/packages/ian_accounts-ui-bootstrap-3.js?hash=e27c97032efae26b11dd04146509e767d9194a4d"></script>
  <script type="text/javascript" src="/packages/webapp.js?hash=3026d4501b6e3076a0aea1f7628466ebbe004a29"></script>
  <script type="text/javascript" src="/packages/livedata.js?hash=7cf1831a60b48e304b054aee1ae0f7e38ff35d09"></script>
  <script type="text/javascript" src="/packages/hot-code-push.js?hash=2e864a0bdd0d5f686115099f8c48eb6c866b5b14"></script>
  <script type="text/javascript" src="/packages/launch-screen.js?hash=2f56943306c7e900ed9f4d894b87f534ebffeaeb"></script>
  <script type="text/javascript" src="/packages/autoupdate.js?hash=1fd9cf3472adaa6887170d88ab5ea1ddabf695fa"></script>
  <script type="text/javascript" src="/packages/global-imports.js?hash=5b2fa358214a42aa3d898f1904a07f63ced7fb52"></script>
  <script type="text/javascript" src="/app/app.js?hash=d41b18152b7ec04d24415a8fbfbc9932f2cbd1bf"></script>
  <script type="text/javascript" src="/packages/service-configuration.js?hash=42ac9ae8eb44f3e73762f9cb0003410397021984"></script>
</body>

(第一次翻页6秒,太长了)

揍你!

1 个答案:

答案 0 :(得分:2)

当您构建生产版本时,Meteor会自动将所有脚本捆绑到一个文件中。

您可以使用--production标记来模拟效果,例如meteor run --production

在开发过程中,Meteor不捆绑各个脚本,以避免在每次更改文件时执行太多操作。