Skip to content

Commit

Permalink
๐Ÿ”ง Add clean-webpack-plugin for build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp1221 committed Aug 8, 2023
1 parent fae4aeb commit bd6344c
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 3 deletions.
195 changes: 195 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
"name": "klas-helper",
"private": true,
"scripts": {
"build": "npm run clean && cross-env NODE_ENV=production webpack --progress",
"clean": "rm -rf dist",
"dev": "npm run clean && cross-env NODE_ENV=development webpack --progress --watch",
"build": "cross-env NODE_ENV=production webpack --progress",
"dev": "cross-env NODE_ENV=development webpack --progress --watch",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
Expand All @@ -20,6 +19,7 @@
"@typescript-eslint/eslint-plugin": "6.2.1",
"@typescript-eslint/parser": "6.2.1",
"babel-loader": "9.1.3",
"clean-webpack-plugin": "4.0.0",
"copy-webpack-plugin": "11.0.0",
"cross-env": "7.0.3",
"eslint": "8.46.0",
Expand Down
2 changes: 2 additions & 0 deletions webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'node:path';
import { type Configuration } from 'webpack';
import CopyPlugin from 'copy-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';

const NODE_ENV = process.env.NODE_ENV || 'development';
const IS_PROD = NODE_ENV === 'production';
Expand Down Expand Up @@ -28,6 +29,7 @@ const config: Configuration = {
],
},
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
patterns: [
{ from: 'public', to: '.' },
Expand Down

0 comments on commit bd6344c

Please sign in to comment.