笔记笔记,网上很多例子都是过期的啊= = 因为jsx转换器整合到babel中了,根本不需要网上所说的jsx-loader
sudo npm install webpack webpack-dev-server babel -g sudo npm install react react-dom babel-loader less-loader css-loader style-loader url-loader file-loader babel-preset-es2015 babel-preset-react --save-dev
module.exports = { entry: { main: './src/index.jsx',es5:'./src/es6.js' },output: { path: 'build',filename: '[name].build.js' },resolve: { extensions: ['','.js','.jsx'] },module: { loaders: [{ test: /\.jsx$/,loader: 'babel-loader',query:{ presets:['es2015','react'] } },{ test: /\.js$/,query:{ presets:['es2015'] } }] } };原文链接:https://www.f2er.com/react/306953.html