【问题标题】:How to configure WebStom with Webpack for Angular2 (cannot find module)?如何使用 Webpack 为 Angular2 配置 WebStom(找不到模块)?
【发布时间】:2026-01-19 17:05:01
【问题描述】:

我正在使用 WebStorm 和 webpack,并且由于我的 tsconfig 设置为 node_modules,WebStorm 不会重新识别我的任何模块的路径,因此与 WebStorm 捆绑的 TypeScript 会发出错误,正如您在我的附件中看到的那样...

tsconfig.json

    {
  "compilerOptions": {
    "target": "ES5",
    "module": "commonjs",
    "moduleResolution": "node",
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "noEmitHelpers": false,
    "sourceMap": true,
    "noResolve": false
  },
  "filesGlob": [
    "./**/*.ts",
    "!./node_modules"
  ],
  "exclude": [
    "node_modules",
    "typings"
  ],
  "compileOnSave": true,
  "buildOnSave": true
}

Webstorm 中的错误:

想知道是否有办法使用 TypeScript 让 Webstorm 成为 Webpack 和 ng2 感知...

发送

肖恩

【问题讨论】:

  • tx 回复...它刚刚在 WebStorm 最新 EA 中修复...问候

标签: intellij-idea webstorm angular webpack


【解决方案1】:

tx 回复...它刚刚在 WebStorm 最新 EA 中修复...版本 144.3143.5 问候

【讨论】: