sprintf.js icon indicating copy to clipboard operation
sprintf.js copied to clipboard

Fix bower component for Angular & Gulp Inject

Open wembernard opened this issue 10 years ago • 6 comments

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?

wembernard avatar Jul 31 '15 09:07 wembernard

+1 :)

sebastientromp avatar Sep 10 '15 14:09 sebastientromp

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?

avivr avatar Dec 20 '15 20:12 avivr

Agree with cut off two project, it have a flexible for non-angular user

yuetyeelo2855 avatar Mar 21 '16 07:03 yuetyeelo2855

+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

patrikx3 avatar May 07 '17 16:05 patrikx3

Yeah, I'll drop it altogether in one of the following days

alexei avatar May 09 '17 15:05 alexei