Polymer 如何配置WebStorm进行调试
我想在WebStorm中调试我的Polymer应用程序,但没有Polymer特定的配置选项。节点配置运行相当于cmd行中的Polymer 如何配置WebStorm进行调试,polymer,webstorm,Polymer,Webstorm,我想在WebStorm中调试我的Polymer应用程序,但没有Polymer特定的配置选项。节点配置运行相当于cmd行中的polymer service,但调试以代码0退出 我知道我可以使用Chrome设置断点并检查代码,但在WebStorm中这样做会更好 以下是我单击“调试”时的输出: /home/user/.node\u modules\u global/bin/polymer--debug brk=38501--expose\u debug\u as=v8debug service /\˜
polymer service
,但调试以代码0退出
我知道我可以使用Chrome设置断点并检查代码,但在WebStorm中这样做会更好
以下是我单击“调试”时的输出:
/home/user/.node\u modules\u global/bin/polymer--debug brk=38501--expose\u debug\u as=v8debug service
/\˜˜/ /\˜˜/\
/__\/聚合物CLI
/\ / /\ /\ /\
/__\/聚合物项目的多工具
\ /\ /\ / /\ /
\/__\/__\/用法:`polymer[选项…]`
\ /\ / /\ /
\/__\/ /__\/
可用命令
analyze将JSON格式的分析元数据写入标准输出
构建一个应用程序风格的项目
“帮助”显示此帮助消息或特定命令的帮助
初始化一个聚合项目
安装安装Bower依赖项,可以选择安装“变体”
lint识别代码中的潜在错误。
serve运行polyserve开发服务器
测试运行web组件测试器
全球选择
--env类型用于专门化特定对象的环境
命令,比如build
--entrypoint将请求的主HTML文件
所有路线。
--shell字符串应用程序shell HTML导入
--按需加载的片段字符串[]HTML导入。
--根字符串项目的根目录。默认值
到当前工作目录。
--与项目源文件匹配的源字符串[]Glob。
默认值为'src/***`。
--与任何其他依赖项匹配的额外依赖项字符串[]全局
分析器未捕获到的依赖项
包括你的建设。
-v、 --详细打开调试输出
-h、 --帮助打印有用的使用信息
-q、 --静音输出
运行'polymer help',获取特定命令的帮助。
进程已完成,退出代码为0
我的html文件:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<title>quick-tour</title>
<meta name="description" content="quick-tour description">
<link rel="manifest" href="/manifest.json">
<script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="/src/quick-tour-app/quick-tour-app.html">
</head>
<body>
<quick-tour-app></quick-tour-app>
<img src="https://www.polymer-project.org/images/logos/p-logo-32.png">
</body>
</html>
快速游览
我的自定义元素:
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
<!--<link rel="import" href="../../bower_components/polymer/lib/elements/dom-if.html">-->
<!--<link rel="import" href="../../bower_components/polymer/lib/elements/dom-repeat.html">-->
<dom-module id="quick-tour-app">
<template>
<style>
:host {
display: block;
}
</style>
<h1>[[prop1]]!</h1>
</template>
<script>
/** @polymerElement */
class QuickTourApp extends Polymer.Element {
static get is() { return 'quick-tour-app'; }
static get properties() {
return {
prop1: {
type: String,
value: 'Hello'
}
};
}
}
customElements.define(QuickTourApp.is, QuickTourApp);
// window.customElements.define(QuickTourApp.is, QuickTourApp);
</script>
</dom-module>
:主持人{
显示:块;
}
[[prop1]]!
/**聚合反应*/
类QuickTourApp扩展了Polymer.Element{
静态get是(){return'quick tour app';}
静态获取属性(){
返回{
建议1:{
类型:字符串,
值:“你好”
}
};
}
}
customElements.define(QuickTourApp.is,QuickTourApp);
//window.customElements.define(QuickTourApp.is,QuickTourApp);
使用Node.js调试器启动Polymer的原因是什么?你要调试你的电脑吗?或者,您只是想调试自定义组件?在后一种情况下,使用polymer serve
在终端中启动polymer web服务器,然后创建运行配置,在那里指定组件URL(您通常在浏览器中输入的URL,如localhost:8080/components/my el/
),然后点击调试
<link rel="import" href="../../bower_components/polymer/polymer-element.html">
<!--<link rel="import" href="../../bower_components/polymer/lib/elements/dom-if.html">-->
<!--<link rel="import" href="../../bower_components/polymer/lib/elements/dom-repeat.html">-->
<dom-module id="quick-tour-app">
<template>
<style>
:host {
display: block;
}
</style>
<h1>[[prop1]]!</h1>
</template>
<script>
/** @polymerElement */
class QuickTourApp extends Polymer.Element {
static get is() { return 'quick-tour-app'; }
static get properties() {
return {
prop1: {
type: String,
value: 'Hello'
}
};
}
}
customElements.define(QuickTourApp.is, QuickTourApp);
// window.customElements.define(QuickTourApp.is, QuickTourApp);
</script>
</dom-module>