使用 WebStorm 的 Vue.js TypeScript 项目的调试器不会在断点处停止

eng*_*erk 6 webstorm typescript vue.js

我使用带有 TypeScript 设置的 WebStorm 创建了新项目。然后,调试器断点不起作用。

我的设置

版本

  • 节点 12.10
  • vue/cli 3.11.0

项目设置

  1. 巴别塔
  2. 打字稿
  3. 路由器
  4. CSS 预处理器
  5. 单元测试

构建设置

  1. 类样式语法 => 是
  2. 用户 Babel 和 Typescript => 是
  3. 使用历史模式 => 否
  4. CSS 预处理器:Sass/Scss dart-sass

代码

调试点位于console.log("started")

<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from './components/HelloWorld.vue';

console.log("satarted")

@Component({
  components: {
    HelloWorld,
},
})
export default class App extends Vue {}
</script>

<style lang="scss">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
Run Code Online (Sandbox Code Playgroud)

WebStorm的调试设置:

在此输入图像描述

然后我单击调试按钮,但它没有在断点处停止。

package.json, tsconfig.json其他文件均为默认设置。

len*_*ena 6

您应该通过运行(而不是调试) npmserve运行配置来启动应用程序,然后选择JavaScript 调试配置并按Debug

请参阅https://blog.jetbrains.com/webstorm/2018/01/working-with-vue-js-in-webstorm/调试应用程序部分