react webpack

1.npm init 初始化项目

npm init -y

2.配置webpack.basic

  npm install --save-dev webpack
  npm install --save-dev webpack-cli

安装环境合并工具

  npm install webpack-merge --save-dev
  npm install --save-dev html-webpack-plugin
  npm install clean-webpack-plugin --save-dev
  npm install --save-dev webpack-dev-server 

css

npm i -D postcss-loader
npm i -D less-loader
npm i -D style-loader
npm i -D css-loader

js

npm install --save-dev @babel/core  @babel/cli
npm install --save @babel/polyfill
npm install --save-dev @babel/preset-react

babel 动态导入

npm install --save-dev @babel/plugin-syntax-dynamic-import
npm install --save-dev @babel/plugin-proposal-class-properties 装饰器依赖
npm install --save-dev @babel/plugin-proposal-decorators 装饰器

你可能感兴趣的:(react webpack)