Webpack: Starting ...
ui/node_modules/schema-utils/dist/validate.js:104
throw new _ValidationError.default(errors, schema, configuration);
^
ValidationError: Invalid options object. Watch Ignore Plugin has been initialized using an options object that does not match the API schema. {
schema: {
title: 'WatchIgnorePluginOptions',
type: 'object',
additionalProperties: false,
properties: {
paths: {
description: 'A list of RegExps or absolute paths to directories or files that should be ignored.',
type: 'array',
items: {
description: 'RegExp or absolute path to directories or files that should be ignored.',
anyOf: [ [Object], [Object] ]
},
minItems: 1
}
},
required: [ 'paths' ]
},
headerName: 'Watch Ignore Plugin',
baseDataPath: 'options',
postFormatter: null
}
Run Code Online (Sandbox Code Playgroud)
它是通过以下配置抛出的:
new webpack.WatchIgnorePlugin([ 'src/test' ])
Run Code Online (Sandbox Code Playgroud)
webpack 的版本是“^5.0.0-rc.6”。根据构造函数
constructor(paths: Array<string | RegExp>)
Run Code Online (Sandbox Code Playgroud)
[ 'src/test' ]
应该没事。我哪里做错了?
小智 12
我从这个问题中得到了答案。
WatchIgnorePlugin 选项应转换为
new webpack.WatchIgnorePlugin({paths: [ 'src/test' ]})
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10978 次 |
最近记录: |