问题
I am trying to solve this problem; Apparently when I use my gulp file I can't link to my bower_components folder.
While trying to come up with a solution, I heard of gulp-bower But the docs seem a little vague. So what is gulp-bower used for? Could this help me?
Anyone run into my problem? Is my gulp file too verbose...
Just as a FYI I set up a components folder which houses index, scss, images and js and I use gulp to stream to a DEV or PROD depending on the situation. But alas I think that maybe the problem...
PATH STRUCTURE
回答1:
This was supposed to be an answer to your original question, but it's suitable here as well.
You can't refer to scripts that are out on top of serving directory of your web server.
You could however link to it, if you're on linux, that would be a ln -s
.
But, there's a better way. Add .bowerrc
to where you install your bower components from, and add this to it:
{
"directory": "folder/in/a/serving/directory"
}
来源:https://stackoverflow.com/questions/25629491/how-is-gulp-bower-used-and-what-is-it-for