Добавил очистку publicDir
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
const fs = require('fs-extra');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
//const webpack = require('webpack');
|
//const webpack = require('webpack');
|
||||||
|
|
||||||
@@ -12,6 +13,8 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|||||||
const publicDir = path.resolve(__dirname, '../dist/tmp/public');
|
const publicDir = path.resolve(__dirname, '../dist/tmp/public');
|
||||||
const clientDir = path.resolve(__dirname, '../client');
|
const clientDir = path.resolve(__dirname, '../client');
|
||||||
|
|
||||||
|
fs.emptyDirSync(publicDir);
|
||||||
|
|
||||||
module.exports = merge(baseWpConfig, {
|
module.exports = merge(baseWpConfig, {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
output: {
|
output: {
|
||||||
@@ -44,7 +47,6 @@ module.exports = merge(baseWpConfig, {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
//new CleanWebpackPlugin({ cleanOnceBeforeBuildPatterns: [`${publicDir}/**`] }),
|
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
filename: "[name].[contenthash].css"
|
filename: "[name].[contenthash].css"
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user