了解与bower_components导入相关的Polymer 1.x Polymer入门工具包文件结构 [英] Understanding Polymer 1.x Polymer Starter Kit file structure as it relates to bower_components imports
问题描述
在Polymer Starter Kit中,每个对bower_components
子目录的引用都指的是app
目录下的一个节点.但是,(至少在我的PSK版本中)bower_components
子目录比app
目录高一级.换句话说,bower_components
子目录实际上位于项目根目录中.
In the Polymer Starter Kit, every reference to the bower_components
subdirectory refers to a node just below the app
directory. However, (at least in my version of PSK) the bower_components
subdirectory is one level up from the app
directory. In other words, the bower_components
subdirectory is actually located in the project root directory.
我只是误算了目录节点吗?还是这与gulp
甚至vulcanize
的工作方式有关?还是我完全不了解的其他事情?
Am I just miscounting my directory nodes? Or does this have something to do with how gulp
and maybe vulcanize
work? Or is it something else altogether that I'm not understanding?
例如,在index.html
中有以下脚本标记:
For example, in index.html
there is this script tag:
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
表示bower_components
目录与index.html
处于同一级别.但事实并非如此. bower_components
实际上是上一级.
which suggests the bower_components
directory is at the same level as index.html
. But it's not. bower_components
is actually one level up.
与元素导入相同.
推荐答案
是的,gulp基本上将所有内容都构建到了构建中,并且Web服务器提供了build文件夹而不是项目.我不记得特别在入门工具包中构建文件夹的名称是什么,但是对于大多数项目来说,它的工作方式就像我所描述的一样
yeah, gulp basically builds everything into a build and the web server serves the build folder instead of the project. I don’t remember what’s the name of the build folder in starter kit in particular, but for most project it works as I described
回应2:
特定于PSK.本地服务器将挂载该目录,并像在
app
内一样提供服务.我刚刚发送了PR来更改此设置,因为它令人困惑
it’s specific to PSK. The local server mounts that directory and serves it as if it were inside
app
. I just sent in a PR to change this because it’s confusing
这篇关于了解与bower_components导入相关的Polymer 1.x Polymer入门工具包文件结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!