2

I have a tsconfig like so

{
  "compileOnSave": false,
  "compilerOptions": {
    "module": "es2015",
    "target": "es2015",
    "sourceMap": true,
    "jsx": "react",
    "allowSyntheticDefaultImports": true,
    "noImplicitAny": false,
    "watch": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "suppressOutputPathCheck": true
  },
  "exclude": [
    "dist",
    "node_modules",
    "bower_components",
    "typings/globals",
    "typings/modules"
  ]
}

And I am using webpack to bundle my project files. Most definition files have been added using typings but certain npm modules includes their own definition files. I want to be able to add those to the typescript compilation. Otherwise I get errors like Cannot find module X

How do I include those definition files in the compilation?

4

1 回答 1

4

某些 npm 模块包含它们自己的定义文件

exclude如果您将这些设置modulecommonjs

于 2016-06-02T01:25:27.193 回答