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

后端 未结 15 2336
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 07:07

I have the following webpack.config.js

var path = require(\"path\");
var webpack = require(\'webpack\');

module.exports = {
  entry: {
    \'ng2-auto-comple         


        
15条回答
  •  情书的邮戳
    2020-12-01 07:35

    Just add:

     "lib": ["es6"] // means at least ES6
    

    Don't change target. Target is used to tell Typescript into which version of ECMAScript to compile your .ts files. Of course, you can change it, if the browser your application will be running in, will support that version of ECMAScript.

    For example, I use "target": "es5" and "lib": ["es6"].


    Another reason could be:

    That your .ts file is not under "rootDir": "./YourFolder",

提交回复
热议问题