Update webpack & remove clean plugin usage
This commit is contained in:
parent
e40d69d5ff
commit
6a2a75dade
3 changed files with 321 additions and 444 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import { resolve } from 'path';
|
||||
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
|
||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
||||
|
||||
const exlcudeCleanFiles = ['favicon.png'];
|
||||
|
||||
export default {
|
||||
resolve: { extensions: ['.js', '.scss'] },
|
||||
entry: {
|
||||
|
|
@ -10,6 +11,11 @@ export default {
|
|||
output: {
|
||||
path: resolve(__dirname, 'src', 'newsreader', 'static'),
|
||||
filename: 'js/[name].bundle.js',
|
||||
clean: {
|
||||
keep: filename => {
|
||||
return exlcudeCleanFiles.find(excludedFile => filename.endsWith(excludedFile));
|
||||
},
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
@ -42,11 +48,5 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin({ filename: 'css/main.css' }),
|
||||
new CleanWebpackPlugin({
|
||||
cleanOnceBeforeBuildPatterns: ['js', 'css', 'fonts'],
|
||||
cleanAfterEveryBuildPatterns: ['!fonts/**'],
|
||||
}),
|
||||
],
|
||||
plugins: [new MiniCssExtractPlugin({ filename: 'css/main.css' })],
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue