webpack配置ES6 + react套装开发
配置ES6
1.安装插件:
babel-loader,babel-preset-es2015,babel-preset-react.
2.添加配置文件中部分内容:
{ test: /\.js$/, loader: 'babel-loader', query: {
presets: ['es2015','react']
} },
配置react
1.安装插件:
react,react-dom,jsx-loader.
2.添加配置文件中部分内容:
{ test: /\.(js|jsx)$/, loader: 'jsx-loader?harmony' }