# webpack **Repository Path**: wip/webpack ## Basic Information - **Project Name**: webpack - **Description**: 使用webpack构建前端项目 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-09-05 - **Last Updated**: 2023-03-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 使用webpack创建的项目 + 完成了项目开发的基本配置 + 实现了列表隔行换色 ### webpack 基础配置 #### 1.开发环境依赖 > npm install -D webpack webpack-cli html-webpack-plugin webpack-dev-server@3.11.2 #### 2.打包css > npm install -D style-loader css-loader #### 3.打包less > npm install -D less less-loader #### 4.打包sass/scss > npm install -D sass node-sass sass-loader #### 5.打包js > npm install -D babel-loader @babel/core @babel/preset-env @babel/plugin-transform-runtime > npm install -S @babel/runtime #### 6.打包vue > npm install -D vue-loader vue-template-compiler ### 使用jquery实现列表隔行换色 #### 1.安装jquery > npm install -S jquery #### 2.src/main.js ``` import $ from "jquery" $(function () { $('li:odd').css('backgroundColor', 'orange') $('li:even').css('backgroundColor', 'green') }) ``` #### 3.src/index.html ```