|
|
@ -1,9 +1,16 @@ |
|
|
|
const path = require("path") |
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin") |
|
|
|
const ProgressBarPlugin = require("progress-bar-webpack-plugin") |
|
|
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin") |
|
|
|
|
|
|
|
const isDevelopment = process.env.NODE_ENV === "development" |
|
|
|
|
|
|
|
// 清理缓存,避免本地缓存越来越大
|
|
|
|
if (isDevelopment) { |
|
|
|
const cachePath = path.resolve(__dirname,"../node_modules/.cache") |
|
|
|
new CleanWebpackPlugin().removeFiles([cachePath]) |
|
|
|
} |
|
|
|
|
|
|
|
const outputPath = (function () { |
|
|
|
return path.resolve(__dirname, "../dist") |
|
|
|
})() |
|
|
|