Webpack 2:node.global 和 resolve.extensions 的空扩展字段配置问题

3
我收到这些消息是根据我的旧的2.1.0-beta.22 webpack配置文件。我需要一些建议,关于如何更改它:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.node.global should be a boolean.
 - configuration.resolve.extensions[0] should not be empty.

目前:
resolve: {

  extensions: ['', '.ts', '.js', '.json'],
  modules: [helpers.root('src'), 'node_modules'],

},

"和"
node: {
  global: 'window',
}

这些是我的配置文件:

1
后缀名: ['', '.ts', '.js', '.json'],刪除'' => 后缀名: ['.ts', '.js', '.json'],在第二版中不需要。 - Hosar
1个回答

0

尝试使用 '*' 代替 ''

resolve: { extensions: ['*', '.js', '.jsx']},

它在rc.7中运行 - 这里的细节


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接