我正在尝试反编译我的react/es6代码,并且来自browserify。由于新的babel 6版本以及大多数教程已经过时,我正在努力创建一个webpack版本。 这工作我.babelrc:使用webpack与babel和babel-preset-react和babel-preset-es2015
{
"presets": ["react"]
}
但是当我把它改成这样:
{
"presets": ["es2015", "react"]
}
它抛出这个神秘的错误: ERROR in ./client/App.js Module build failed: Error: You gave us a visitor for the node type "NumericLiteral" but it's not a valid type
这是我webpack.config.js如果有帮助的话:
module.exports = {
entry: "./client/App.js",
output: {
filename: "public/bundle.js"
},
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
}
]
}
};
是t这里有什么明显的我失踪了?我也交换了预设的顺序,它似乎没有什么区别。我的节点模块中有babel-core,babel-loader,babel-preset-es2015,babel-preset-react和webpack。
你见过github仓库的[troubleshoot section](https://github.com/babel/babel-loader#troubleshooting)吗? – Rik