Skip to content

Commit

Permalink
Merge pull request #30 from bigopon/master
Browse files Browse the repository at this point in the history
fix(build): update deps
  • Loading branch information
EisenbergEffect authored Jun 28, 2019
2 parents 418f5e4 + c454903 commit ce855f5
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 497 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ If you want to reuse the same `Aurelia` instance for multiple enhancements, you
});
```

### Using aurelia-script with ES5:

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.

### What is with `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:
Expand Down
21 changes: 15 additions & 6 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,23 @@ export default [
]
},
].map(config => {
const es6Mappings = {
'aurelia-templating-binding': './node_modules/aurelia-templating-binding/dist/es2015/aurelia-templating-binding.js',
'aurelia-route-recognizer': './node_modules/aurelia-route-recognizer/dist/es2015/aurelia-route-recognizer.js',
'aurelia-loader': './node_modules/aurelia-loader/dist/es2015/aurelia-loader.js'
}
config.plugins.unshift({
resolveId(importee) {
return importee === 'aurelia-templating-binding'
? './node_modules/aurelia-templating-binding/dist/es2015/aurelia-templating-binding.js'
: importee === 'aurelia-route-recognizer'
? './node_modules/aurelia-route-recognizer/dist/es2015/aurelia-route-recognizer.js'
: null;
return es6Mappings[importee] || null;
}
})
});
config.onwarn = function(warning, warn) {
// skip certain warnings
if (warning.code === 'UNUSED_EXTERNAL_IMPORT') return;

if (warning.code === 'NON_EXISTENT_EXPORT') return;

throw new Error(warning.message);
};
return config;
})
Loading

0 comments on commit ce855f5

Please sign in to comment.