Bower and handling of external dependencies#13
Bower and handling of external dependencies#13guybedford merged 1 commit intoModuleLoader:masterfrom
Conversation
|
Good point... one way might be to use a data attribute on the script tag to set the esprima location, for example: <script src="es6-module-loader.js" data-esprima-src="/js/esprima/esprima.js"></script>I like the default behaviour of loading from the same folder though. Any other suggestions welcome. |
|
@passy Hah, I was just going to submit this. |
|
Were there any oppositions to the suggestion @guybedford made about using data attribs. for the esprima location? any alternative suggestions?. |
|
Looks like a good solution too me. Can't come up with anything else. |
|
I like the solution, too. +1 |
Bower and handling of external dependencies
|
The only issue with the data attribute method is that it is impossible for another script to then inform the esprima location. Rather I've included a check for the Thus one would write: <script>esprimaSrc='bower_components/esprima-harmony/esprima.js'</script>
<script src="es6-module-loader.js"></script> |
How so?
Yuk, global... |
|
Ok sure... |
I think it's worth discussing how
es6-module-loadershould handle the esprima dependency when installed via a package manager. Sinceesprimais loaded lazily and the loader expects it in a certain place, it should be included in the package. Vendoring external dependencies, however, is nonoptimal when using package managers.I attached a sample
bower.jsonthat excludes the bundled esprima version and lists it as dependency. How would you like to handle this?