I'm currently trying to bundle an Aurelia app for "production". I tried using $ aurelia bundle
, or now with gulp; which is quite the same. But I'll always have
<script src="jspm_packages/system.js"></script>
<script src="config.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
In my index.html
, which mean that I have to upload jspm packages on my server (ok, not all maybe), and that Babel's 1.9mb browser.js
file will be loaded in the browser and only then it will transpilate. It can be pretty long.
Is there any way to get a bundled-transpiled-minified file? Does it make sense? Thanks a lot!
Here's my config (in my 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
andconfig.js
implies needingbrowser.js
or even any jspm packages? In order to load system.js, you only need the files in the top-level of jspm_packages (on my system, currently, that is system.js, system-csp-production.js, and system-polyfills.js) – Michael Malone