- Deploying a bundled Aurelia app using Gulp to a server
- Toggling between the src folder (non-bundled) and the dist folder (bundled)
Watch the video walk-through below or skip past it to read more.
Deploying a minified Aurelia app using Gulp:
I haven’t been able to find much information on bundling an Aurelia app using Gulp. As of this writing there are a few blog posts but they appear to be a mix of pre-beta documentation and may or may not work today.
When you created your first Aurelia app, you probably downloaded the getting started docs here: http://aurelia.io/downloads/kit-es2016.zip
However, these still need to be manually configured to be bundled. Luckily they released another set of skeleton templates on github that are gulp ready. All the configuration settings are there and you don’t have to do anything. The link is here:
5. Run http-server (or your web server of choice)
The sample app should run fine. I suggest downloading this skeleton template as your starting point b/c when you are ready to deploy your app with gulp you have almost nothing to do.
Once you get the skeleton copy running, now you need to add your own application files to it. You can either start building a new app from scratch or copy/paste your existing files into the skeleton. Be careful to not overwrite the config files and instead only add your custom settings to the existing files.
Toggling between the Src and Dist folders
The only tricky part is that since the skeleton download is gulp-ready, the config file is pointing to the distribution folder. This is fine unless you want to debug your app b/c everything is now minified. For development you want your app to point to the src folder so that you are running the un-minified JS files. This is easy enough to do.