有谁知道如何使用Visual Studio运行Polymer 3?
我已经使用polyserve开发服务器完成了演示 . 但是,我无法在Visual Studio中使用相同的代码 . 我认为这不会取决于托管环境 .
我使用这些说明创建了一个聚合物元素:https://www.polymer-project.org/3.0/start/first-element/intro
它按预期工作 . 当我将代码移动到visual studio时,我得到:
无法解析模块说明符'@ polymer / polymer / polymer-element.js'
我注意到当我运行polyserve时,我收到64页请求 . 当我在Visual Studio中执行它时,我得到3 - 我的html,webcomponents-loader.js和demo-element.js
1 回答
It does not matter which editor you are using . 我只将VS Code用于聚合物-3x .
在本地安装聚合物后,可以使用polymer CLI创建元素 .
在目录中创建一个要启动项目的目录和
cd
在此位置打开终端并键入以下聚合物cli命令
polymer init
- >选择polymer-3-element
,这将创建您的hello world元素polymer serve
启动服务器 . 你可以查看你的元素http://localhost:8080