我正在使用这个 webpack 文件,但出现错误。
这是 webpack 文件:
const path = require('path');
module.exports = {
target: 'node',
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'build')
},
module: {
rules: [
{
test: /\.js?$/,
loader: 'babel-loader',
exclude: /node_modules/,
options: {
presets: [
'react',
'stage-0',
['env', { targets: { browsers: ['last 2 versions']}}]
]
}
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
这是错误消息:
Invalid configuration object. Webpack has been initialised using a
configuration object that does not match the API schema.
- configuration.context: The provided value …Run Code Online (Sandbox Code Playgroud)