我目前正在尝试捆绑Aurelia应用程序"production" . 我尝试使用 $ 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
}
}
}
1 回答
听起来你有启用babel的
runtime
选项,其中babel只是在运行时而不是在开发时转换你的JavaScript .如果您将捆绑包设置为在运行时编译而不是已编译,那么它应该更快,占用空间更小 .