update
This commit is contained in:
parent
5253b8246d
commit
d4679d368d
21
webpack.md
21
webpack.md
@ -65,4 +65,23 @@ module.exports = config;
|
||||
### 插件
|
||||
loader可以作为转换某种类型的模块
|
||||
插件可以做各式各样的工作?
|
||||
引用插件 先require
|
||||
引用插件 先require()
|
||||
然后加入到plugis数组中
|
||||
```
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin'); // 通过 npm 安装
|
||||
const webpack = require('webpack'); // 用于访问内置插件
|
||||
|
||||
const config = {
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.txt$/, use: 'raw-loader' }
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({template: './src/index.html'})
|
||||
]
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user