了解与bower_components导入相关的Polymer 1.x Polymer入门工具包文件结构 [英] Understanding Polymer 1.x Polymer Starter Kit file structure as it relates to bower_components imports

查看:102
本文介绍了了解与bower_components导入相关的Polymer 1.x Polymer入门工具包文件结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆