Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.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
Webpack v5:排除时排除不再工作_Webpack - Fatal编程技术网

Webpack v5:排除时排除不再工作

Webpack v5:排除时排除不再工作,webpack,Webpack,我正在迁移到WebpackV5,对exclude中的exclude的支持似乎已被删除。不过,我在迁移指南中没有看到任何相关内容。有什么想法吗 在webpack v4中,我的webpack配置文件中包含以下内容: { test: /\.(ts|js)$/, exclude: [ { // Exclude node_modules from running thro

我正在迁移到WebpackV5,对exclude中的exclude的支持似乎已被删除。不过,我在迁移指南中没有看到任何相关内容。有什么想法吗

在webpack v4中,我的webpack配置文件中包含以下内容:

        {
            test: /\.(ts|js)$/,
            exclude: [
                {
                    // Exclude node_modules from running through babel-loader
                    test: path.resolve(__dirname, "node_modules"),
                    // Include (exclude from the exclusion) the MYCUSTOM folder.
                    // This is needed since MYCUSTOM itself isn't run through any transpilation but offered as a straight up typescript library.
                    exclude: path.resolve(
                        __dirname,
                        "node_modules/@MYORG/MYCUSTOM"
                    )
                }
            ],
            use: {
                loader: "babel-loader",
                options: {
                    cacheDirectory: true,
                    compact: false
                }
            }
        },
现在,在webpack v5中,我得到一个错误:

configuration.module.rules[1]。exclude具有未知属性“test”。这些属性是有效的: 对象{和?、不是?、或}

我在文档中没有看到任何关于为什么删除它以及使用什么的答案。有什么建议吗