/script

The home for Aurelia's concatenated script-tag-ready build.

Primary LanguageJavaScriptMIT LicenseMIT

aurelia-script

Join the chat at https://gitter.im/aurelia/discuss

This repo is the home for Aurelia's concatenated script-tag-ready build.

To keep up to date on Aurelia, please visit and subscribe to the official blog and our email list. We also invite you to follow us on twitter. If you have questions, please join our community on Gitter or use stack overflow. Documentation can be found in our developer hub.

Online Playground with Single file script

Build

  1. Install the dependencies
npm install
  1. Run either the build / bundle script
# Build only core
npm run build
# Or full build, with router
npm run bundle

Run the example project

  1. Go to example folder inside this project
  2. Start a http server
  3. Navigate to index.html in browser

How it works?

  1. dist folder contains built result of all aurelia bundles, together with their minified versions, with different scopes:
    • bundles with names ending in .esm.js are in ESM (ECMAScript Module) format. bundles with names ending in .umd.js are in UMD (Universal Module Definition) format.
    • aurelia.esm.js, aurelia.umd.js are bundles without router feature. Typically used when you want to minimized to script included in your page.
    • aurelia_router.esm.js, aurelia_router.umd.js are bundles of with router feature.
  2. example folder contains an example application to get started. Step to run it included in the section above
  3. scripts folder contains all built result of all aurelia core modules, in AMD module format for environment like gistrun (https://gist.run)
  4. build folder contains entry/ setup script, code for building / emiting code to dist and example folders.
    • index.js and index.full.js are custom entries to give rollup instruction how to bundle all core modules. index.js will result in a bundle without router related features. index.full.js will result in a bundle with all features.
    • rollup.config.js is rollup config for running npm run bundle and npm run build scripts

Notes:

aurelia-script uses new ECMAScript feature: dynamic import via import() API. If your target browser does not support such API, aurelia-script won't be able to run. Browser support matrix is at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Browser_compatibility (check for Dynamic import)