Webpack v5:排除时排除不再工作
我正在迁移到WebpackV5,对exclude中的exclude的支持似乎已被删除。不过,我在迁移指南中没有看到任何相关内容。有什么想法吗 在webpack v4中,我的webpack配置文件中包含以下内容:Webpack v5:排除时排除不再工作,webpack,Webpack,我正在迁移到WebpackV5,对exclude中的exclude的支持似乎已被删除。不过,我在迁移指南中没有看到任何相关内容。有什么想法吗 在webpack v4中,我的webpack配置文件中包含以下内容: { test: /\.(ts|js)$/, exclude: [ { // Exclude node_modules from running thro
{
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”。这些属性是有效的:
对象{和?、不是?、或}
我在文档中没有看到任何关于为什么删除它以及使用什么的答案。有什么建议吗