Closed mgol closed 7 years ago
The whole module import examples:
CommonJS:
const uiRouterExtras = require('ui-router-extras');
angular.module('myModule', [uiRouterExtras]);
ES6 (when used with Webpack etc.):
import uiRouterExtras from 'ui-router-extras';
angular.module('myModule', [uiRouterExtras]);
I've also added exports for separate nodules, example:
import uiRouterExtrasTransition from 'ui-router-extras/modules/transition';
angular.module('myModule', [v]);
Remaining issues:
./modules/*.js
files in the form of require
-ing everything that's required (no pun intended).WDYT?
Thanks for the PR!
I think these exports belong in the individual source files like src/dsr.js
. Then, the angular module name will also be included into the bundled files too (which go onto the CDNs, etc)
Here's what I'm talking about: https://github.com/christopherthielen/ui-router-extras/compare/export_module_names?expand=1
The downside is that without the commonjs modules/*
from your PR, we don't get the automaticrequire()
ing of the dependent modules like ui-router-core. I'd love to convert to a commonjs + webpack build, but at this point in ui-router-extras lifespan I'm wary of changing things up much.
We could check if we're in a CommonJS environment and require dependencies then. Something like: https://github.com/krispo/angular-nvd3/blob/v1.0.9/src/angular-nvd3.js#L7-L11
@christopherthielen What do you think about my proposal?
@mgol that sounds like a reasonable approach. Want to update your PR?
Sure! Just not today. :)
I assume this PR is no longer needed since the whole repository is EOL'd.
Fix #326