【发布时间】:2016-03-16 08:59:06
【问题描述】:
我目前正在尝试将 Aurelia 应用程序捆绑用于“生产”。我尝试使用$ aurelia bundle,或者现在使用 gulp;这是完全一样的。但我会一直拥有
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
在我的index.html 中,这意味着我必须在我的服务器上上传 jspm 包(好吧,也许不是全部),并且 Babel 的 1.9mb browser.js 文件将被加载到浏览器中,然后它才会转译.可能会很长。
有什么方法可以得到一个捆绑转译缩小的文件?是否有意义? 非常感谢!
这是我的配置(在我的 gulpfile.js 中)
bundles: {
"src/dist/app-bundle": {
includes: [
'*',
'aurelia-bootstrapper',
'aurelia-fetch-client',
'aurelia-router',
'aurelia-templating-binding',
'aurelia-templating-resources',
'aurelia-templating-router',
'aurelia-loader-default',
'aurelia-history-browser',
'aurelia-auth'
],
options: {
inject: true,
minify: true
}
}
}
【问题讨论】:
-
我不明白
system.js和config.js如何暗示需要browser.js甚至任何jspm 包?为了加载system.js,你只需要jspm_packages顶层的文件(在我的系统上,目前是system.js、system-csp-production.js和system-polyfills.js)跨度>
标签: javascript ecmascript-6 babeljs aurelia