> For the complete documentation index, see [llms.txt](https://azr.gitbook.io/webpack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://azr.gitbook.io/webpack/shi-zhan/ti-qu-wen-jian.md).

# 提取文件

使用`extract-text-webpack-plugin`来进行将包提取为文件。&#x20;

### 安装

```javascript
$ npm i extract-text-webpack-plugin -D
```

### �webpack.config.js

```javascript
const ExtractTextPlugin = require('extract-text-webpack-plugin');


module.exports = {
  plugins: [
    new ExtractTextPlugin({
      filename: `[name]_[contenthash:8].css`,// 给输出的 CSS 文件名称加上 Hash 值
    }),
  ],
};
```
