代码之家  ›  专栏  ›  技术社区  ›  PlayMa256

使用typescript响应热重新加载

  •  0
  • PlayMa256  · 技术社区  · 6 年前

    tsx . 为此,我紧随其后 https://github.com/TypeStrong/ts-loader/tree/master/examples/react-hot-boilerplate

    我又加了一句

     use: [
              { loader: 'ts-loader', options: { happyPackMode: true } }
    ],
    

    所以我开始出现奇怪的编译错误:

    ./client/main.tsx//<-我的入口点出错

    模块生成失败 (from./node_modules/ts loader/index.js):类型错误:无法读取 未定义的属性“getEmitOutput” 在Object.getEmitOutput(………/node_modules/ts loader/dist/instances.js:190:41)

    {
        "compilerOptions": {
            "allowJs": true,
            "checkJs": false,
            "allowSyntheticDefaultImports": true,
            "esModuleInterop": true,
            "target": "es5",
            "jsx": "react",
            "lib": [
                "es2015",
                "es2016",
                "es2017",
                "dom",
                "es7"
            ],
            "downlevelIteration": true,
            "typeRoots": [
                "./@types"
            ],
            "sourceMap": true,
            "noUnusedLocals": true,
            "noUnusedParameters": true
        },
        "include": [
            "./client/**/*",
            "./@types/**/*"
        ],
        "exclude": [
            ".svn"
        ]
    }
    
    0 回复  |  直到 6 年前