webpack自动清除目录插件
项目打包文件dist中只留下项目打包输出文件
yarn add clean-webpack-plugin --dev
const path = require('path')
//导入clean-webpack-plugin插件,需要解构
const {
CleanWebpackPlugin} = require('clean-webpack-plugin')
module.exports = {
mode: 'none',
entry: './src/main.js',
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'dist'),
publicPath: 'dist/'
},
module: {
rules: [
{
test: /.md$/,
use: [
'html-loader',
'./markdown-loader'
]
}
]
}