html
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular-aria.min.js"></script>
webpack
externals: {
"angular": "angular",
"angular-aria": "window.angular.module['ngAria']",
}
index.js
import ngAria from 'angular-aria';
export default angular
.module( 'app.directives', ['ngAria'] )
.name;
console feedback:
'Uncaught ReferenceError: aria is not defined'
the code related to feedback
module.exports = angular-aria;
on top of this issue, two extra questions
- is it possible to use CDN with different complier like rollup?
- how to detect angular-aria loaded? (so i can provide fallback)
My bad, by following the Bower set, you can achieve this I shall check the Doc earlier
SOLUTION
html
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular-aria.min.js"></script>
<script>
if (!window.angular.module['ngAria']) { document.write('<script type="text/javascript" src="/content/Dotcom/js/vendor/angular-aria.min.js"><\/script>'); }
</script>
webpack
externals: {
"angular": "angular",
}
index.js
import ngAria from 'angular-aria';
export default angular
.module( 'app.directives', ['ngAria'] )
.name;