Fix bower component for Angular & Gulp Inject
I can't load automagically the angular sprintf filter.
bower install sprintf --save correctly installs the bower component.
However, my gulp inject task only loads sprintf.js
<script src="../bower_components/sprintf/src/sprintf.js"></script>
instead of both sprintf.js & angular-sprintf.js and by the way, should take the dist & minified ones
<script src="../bower_components/sprintf/dist/sprintf.min.js"></script>
<script src="../bower_components/sprintf/dist/angular-sprintf.min.js"></script>
Any suggestion or workaround?
+1 :)
This can be solved manually by specifying both files on the "main" entry in bower.json file.
"main": ["src/sprintf.js", "src/angular-sprintf.js" ],
or (dist + minified):
"main": ["dist/sprintf.min.js", "dist/angular-sprintf.min.js" ],
But that's also mean that the angular module will be loaded for those who install sprintf.js on a non-angular project, which will make their build failed. maybe a good solution will be to split this into two separate projects/packages. so you will have the option to install angular-sprintf.
e.g.
bower install sprintf
bower install angular-sprintf
what do you think?
Agree with cut off two project, it have a flexible for non-angular user
+1 for the two projects. I could see a lot of people hitting this and having to manually work through the problem.
FWIW, as a temporary work around people can override the main in their own bower.json
"overrides": {
"sprintf": {
"main": [ "src/sprintf.js", "src/angular-sprintf.js" ]
}
}
please remove angular-sprintjs, we do not use angular1, please add angular-sprintf in different bower package
Yeah, I'll drop it altogether in one of the following days