From 0843cf074f0aef55406ac1ea33eb1c62ff021357 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Wed, 6 Dec 2023 11:56:57 -0500 Subject: [PATCH] perf: rm old files with dev build scripts + improve watch cpu usage --- package.json | 4 ++-- webpack.config.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 75766abe..e2e67d5e 100755 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "index.js", "scripts": { "build": "npx webpack --mode=production", - "build-dev": "npx webpack --mode=development", - "watch": "npx webpack --mode=development --watch", + "build-dev": "rm -r build/www/* && npx webpack --mode=development", + "watch": "rm -r build/www/* && npx webpack --mode=development --watch", "gobuild": "./buildandrun.sh", "lint": "npx eslint src/js", "lint-fix": "npx eslint --fix src/js", diff --git a/webpack.config.js b/webpack.config.js index ed4d4081..c3e81ebd 100755 --- a/webpack.config.js +++ b/webpack.config.js @@ -32,10 +32,11 @@ const config = { }, devServer: { static: './dist', - contentBase: './distgetuk', + contentBase: './dist', }, watchOptions: { poll: 1000, + ignored: /node_modules/, }, plugins: [ new HtmlWebpackPlugin({