# study-webpack **Repository Path**: zheng7yan/study-webpack ## Basic Information - **Project Name**: study-webpack - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-08-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README - 使用`npx build`命令会生成`dist/main.js` `npm run build`也可以 - `assets management` - `css file` `npm install --save-dev style-loader css-loader` ``` + module: { + rules: [ + { + test: /\.css$/, + use: [ + 'style-loader', + 'css-loader' + ] + } + ] + } ``` - `load images` `npm install --save-dev file-loader` ``` + { + test: /\.(png|svg|jpg|gif)$/, + use: [ + 'file-loader' + ] + } ``` - `load data` `npm install --save-dev csv-loader xml-loader` - `html-webpack-plugin` will generate its own index.html in `dist` folder `npm install --save-dev html-webpack-plugin` - `clean-webpack-plugin` `npm install --save-dev clean-webpack-plugin`