Understanding Polymer 1.x Polymer Starter Kit file structure as it relates to bower_components imports

假如想象 提交于 2019-12-13 04:00:39

问题


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.

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?

For example, in index.html there is this script tag:

index.html
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>

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.

Same for element imports.


回答1:


Compilation of responses from Polymer Slack Site:

Response #1:

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

Response #2:

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



来源:https://stackoverflow.com/questions/34142722/understanding-polymer-1-x-polymer-starter-kit-file-structure-as-it-relates-to-bo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!