如何离线使用聚合物入门套件文档和演示?
how to use polymer starter kit doc & demo offline?
我已经安装了 Polymer 入门套件 1.3.0,使用 gulp 服务我可以访问位于 localhost:5000.
的应用程序文件夹中的 index.html
我有两个问题。
1) 我的问题是如何在网络浏览器上访问位于 /bower-components/ 的预开发组件?
我已经尝试在 /bower-components/ 中安装和服务 gulp,但它仍然服务于 /app/index/
我无法在 Web 浏览器上访问组件引用。
2) 完成开发后如何在没有 gulp 的情况下托管它,例如。在 xampp?
您可以使用 Python's HTTP server 提供 bower_components
目录,允许您离线访问子目录:
- 打开一个终端进入
bower_components/
- 运行:
python -m SimpleHTTPServer 8000
在端口 8000 上启动一个 http 服务器。
- 打开浏览器http://localhost:8000/{dir}, where
{dir}
is the directory name of the component you wish to view (e.g., http://localhost:8000/paper-ripple/).
我认为在初学者工具包中,bower_components 目录映射到 /components url 当您使用 gulp 服务时。这与您的 app/elements 目录相同 url。
这是为了让您的应用程序元素可以通过 url of ../polymer/polymer.html 访问聚合物(其他元素也类似)
我已经安装了 Polymer 入门套件 1.3.0,使用 gulp 服务我可以访问位于 localhost:5000.
的应用程序文件夹中的 index.html我有两个问题。
1) 我的问题是如何在网络浏览器上访问位于 /bower-components/ 的预开发组件?
我已经尝试在 /bower-components/ 中安装和服务 gulp,但它仍然服务于 /app/index/
我无法在 Web 浏览器上访问组件引用。
2) 完成开发后如何在没有 gulp 的情况下托管它,例如。在 xampp?
您可以使用 Python's HTTP server 提供 bower_components
目录,允许您离线访问子目录:
- 打开一个终端进入
bower_components/
- 运行:
python -m SimpleHTTPServer 8000
在端口 8000 上启动一个 http 服务器。 - 打开浏览器http://localhost:8000/{dir}, where
{dir}
is the directory name of the component you wish to view (e.g., http://localhost:8000/paper-ripple/).
我认为在初学者工具包中,bower_components 目录映射到 /components url 当您使用 gulp 服务时。这与您的 app/elements 目录相同 url。
这是为了让您的应用程序元素可以通过 url of ../polymer/polymer.html 访问聚合物(其他元素也类似)