# webpack4.x **Repository Path**: lzptg/webpack4.x ## Basic Information - **Project Name**: webpack4.x - **Description**: 基本的webpack构建过程 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-01-16 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # webpack4.X #### 安装教程 1. npm init -y 2. 新建文件件src,及src文件夹下的文件index.html,main.js 3. 新建配置文件webpack.config.js 4. cnpm install webpack webpack-cli -D 5. cnpm install webpack-dev-server -D 6. cnpm install clean-webpack-plugin html-webpack-plugin -D 7. 添加 webpack.config.js 的配置文件内容 8. 修改 package.json 中 'scripts' 的快捷键设置 9. 在main.js中添加热启动判断 10. 添加样式加载项 loader 10.1 cnpm install style-loader css-loader less less-loader -D 10.2 cnpm install extract-text-webpack-plugin@next -D 样式表分离 11. 添加 .gitignore 文件,git工具过滤操作