TS2304 Cannot find name 'Map', 'Set', 'Promise'

此问题解决地址

解决地址:https://stackoverflow.com/questions/39416691/webpack-ts2304-cannot-find-name-map-set-promise

原因

由于Map和Setes6的特性,之前我的tsconfig.json设置的"target" : "es5"导致不能引入新的特性,因此需要更换为"target" : "es6"再执行就Ok了

{
  "compilerOptions": {
    "target": "es6",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "module": "system",
    "moduleResolution": "node",
    // <-----
    "noImplicitAny": false
    //    "outDir": "../../templates/build",
    //    "rootDir": "../../templates/script"
  }
  //  "exclude": [
  //    "node_modules",
  //    "typings/main",
  //    "typings/main.d.ts"
  //  ]
    ,
    "include": ["./script/**/*"]
    ,
    "exclude": ["node_modules","js"]
}

你可能感兴趣的:(前端--开发)