【发布时间】:2017-05-23 03:27:56
【问题描述】:
我的 Webpack 配置出错:
配置对象无效。 Webpack 已使用与 API 架构不匹配的配置对象进行初始化。
configuration.output.path:提供的值"./"不是绝对路径!
这是我的webpack.config.js:
var config = {
entry: './main.js',
output: {
path:'./',
filename: 'index.js',
},
devServer: {
inline: true,
port: 8080
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}
]
}
}
module.exports = config;
【问题讨论】:
-
可能会做
require('path').resolve(__dirname, './')
标签: node.js reactjs configuration webpack