
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
aurelia-script
Advanced tools
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.
In the good old day, you chuck in a script tag into your html and start writing app. Aurelia Script is a way to help you return to that, with Aurelia. Simply add:
<script src='https://unpkg.com/aurelia-script@1.5.2'></script>
into your main html and you are ready to go, like the following:
<script>
au
.start({
debug: true,
// root: 'app.js', // can be ommitted, default is app.js
// host: document.body // can be ommitted, default is document.body
})
.catch(ex => {
document.body.textContent = `Bootstrap error: ${ex}`;
})
</script>
If you want to enhance a section of your page, which is a typical requirement in CMS environment:
<script>
au
.enhance({
host: document.querySelector('.datepicker')
// root can be a string, an object or a constructor function
// aurelia will automatically instantiate if a function is given
root: class DatePickerViewModel {
format = 'dd/MM/yyyy'
},
});
</script>
If you want to reuse the same Aurelia instance for multiple enhancements, you can do:
var aurelia = new au.Aurelia();
aurelia.start().then(() => {
// here you are ready to enhance or start a new app
});
For some projects that need to run in ES5, there are 2 dists that can be used: dist/aurelia_no_loader.es5.umd.js and dist/aurelia_router_no_loader.es5.umd.js (or equivalent minified versions). This is great when you just want to use Aurelia for its templating/binding capabilities (progressive enhancement, sub section of a bigger app for example). As their name suggest, there's no loader bundled with them, but you can easily add a loader to fit your need, in case you need to dynamically load a module. Both Requirejs and SystemJS are compatible with ES5 environments to dynamically load modules at runtime. Just make sure you configure Aurelia modules aliases correctly if those modules happen to have a dependencies on one of Aurelia modules.
au:au is a global namespace for all exports from Aurelia modules, instead of importing from aurelia-framework module. This is because aurelia-script is bundled in UMD module format, to enable simple, old school style usage. For example:
The equivalent of
import { CompositionEngine, ViewCompiler } from 'aurelia-framework';
In Aurelia Script would be:
const { CompositionEngine, ViewCompiler } = au;
There is another distribution bundle that is in ES module format, which you can think of it as a barrel export version of all Aurelia modules in ESM. For example:
The equivalent of
import { BindingEngine, CompositionEngine, ViewCompiler } from 'aurelia-framework';
In Aurelia Script esm distribution would be:
import {
BindingEngine,
CompositionEngine,
ViewCompiler
} from 'https://unpkg.com/aurelia-script@1.5.2/dist/aurelia.esm.min.js';
npm install
# Build only core
npm run build
# Or full build, with router
npm run bundle
index.html in browserdist folder contains built result of all aurelia bundles, together with their minified versions, with different scopes:
.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.example folder contains an example application to get started. Step to run it included in the section abovescripts folder contains all built result of all aurelia core modules, in AMD module format for environment like gistrun (https://gist.run)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 scriptsaurelia-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)
FAQs
Aurelia's concatenated script-tag-ready build.
The npm package aurelia-script receives a total of 53 weekly downloads. As such, aurelia-script popularity was classified as not popular.
We found that aurelia-script demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.