readme.md 661 Bytes

https://scotch.io/tutorials/setup-a-react-environment-using-webpack-and-babel

yarn config set registry 'https://registry.npm.taobao.org'

yarn add webpack webpack-dev-server path

yarn add babel-loader babel-core babel-preset-es2015 babel-preset-react --dev

yarn add html-webpack-plugin

yarn add react react-dom

# 产品编译及压缩
# https://webpack.js.org/guides/production-build/
webpack -p

# 线上环境产生文件名带md5的文件
# https://webpack.js.org/guides/caching/

output: {
  path: path.resolve('dist'),
  filename: '[name].[chunkhash]_bundle.js'
}

# https://github.com/baldore/open-browser-webpack-plugin 打开浏览器