Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
网页包5 Typescript键入缓存失败_Typescript_Caching_Webpack - Fatal编程技术网

网页包5 Typescript键入缓存失败

网页包5 Typescript键入缓存失败,typescript,caching,webpack,Typescript,Caching,Webpack,我有一个带有typescript的基本项目 它包括几个ts文件和html代码。我正在尝试使用缓存设置重建。我必须使用基于文件的缓存(这是一项要求)。 问题是重建后我找不到打字 tsconfig.json { "compilerOptions": { "outDir": "./build", "declarationDir": "./build/types", "

我有一个带有typescript的基本项目 它包括几个ts文件和html代码。我正在尝试使用缓存设置重建。我必须使用基于文件的缓存(这是一项要求)。 问题是重建后我找不到打字

tsconfig.json

{
  "compilerOptions": {
    "outDir": "./build",
    "declarationDir": "./build/types",
    "moduleResolution": "node",
    "sourceMap": true,
    "noImplicitAny": true,
    "module": "commonjs",
    "target": "es5",
    "declaration": true,
    "lib": [
      "es6",
      "es7",
      "dom"
    ]
  }
}
网页包配置

module.exports = {
    entry: {index: "./src/index.ts"}, 
    cache: { type: 'filesystem' },
    ....

    output: {
        filename: "[name].js",
        libraryTarget: "commonjs2",
        path: path.resolve("./build"),
    },
    plugins: [
        new CleanWebpackPlugin(),
       ....
    ],
    
    module: {
        rules: [
            {
                test: /\.ts$/,
                include: /src/,
                use:
                    [
                        {
                            loader: 'ng-annotate-loader',
                            options: {
                                add: true
                            }
                        },
                        {
                            loader: 'ts-loader',
                            options: {
                                onlyCompileBundledFiles: true
                            }
                        },
                    ]
            },
            ....
        ]
    }
};
如果我做构建,我会将js代码捆绑在“types”文件夹中的output+typings上。 “重建类型”文件夹消失后。 对于WebpackV4,它运行良好