小编Ash*_*mad的帖子

无效的配置对象:webpack.server.js

我正在使用这个 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)

webpack-dev-server

0
推荐指数
1
解决办法
1394
查看次数

标签 统计

webpack-dev-server ×1