@stanlemon/webdev 0.1.199 → 0.1.201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,8 +14,8 @@ package.json
14
14
  "start": "webpack serve",
15
15
  "build": "NODE_ENV=production webpack",
16
16
  "test": "jest",
17
- "lint": "eslint --ext js,jsx,ts,tsx ./src/",
18
- "lint:fix": "eslint --fix --ext js,jsx,ts,tsx ./src/"
17
+ "lint": "eslint .",
18
+ "lint:fix": "eslint --fix ."
19
19
  },
20
20
  "dependencies": {
21
21
  "@stanlemon/webdev": "*"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stanlemon/webdev",
3
- "version": "0.1.199",
3
+ "version": "0.1.201",
4
4
  "description": "My typical web development setup, but without all the copy and paste.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -11,33 +11,26 @@
11
11
  "author": "Stan Lemon <stanlemon@users.noreply.github.com>",
12
12
  "license": "MIT",
13
13
  "engines": {
14
- "node": ">=18.0"
14
+ "node": ">=20.0"
15
15
  },
16
16
  "type": "commonjs",
17
17
  "scripts": {
18
18
  "build": "WEBDEV_ENTRY=./example.tsx webpack build",
19
- "lint": "eslint --ext js,jsx,ts,tsx ./",
20
- "lint:fix": "eslint --fix --ext js,jsx,ts,tsx ./"
19
+ "lint": "eslint .",
20
+ "lint:fix": "eslint --fix ."
21
21
  },
22
22
  "dependencies": {
23
- "@babel/cli": "^7.25.7",
24
- "@babel/core": "^7.25.7",
25
- "@babel/plugin-transform-private-property-in-object": "^7.25.7",
26
- "@babel/preset-env": "^7.25.7",
27
- "@babel/preset-react": "^7.25.7",
28
- "@babel/preset-typescript": "^7.25.7",
23
+ "@babel/cli": "^7.25.6",
24
+ "@babel/core": "^7.25.2",
25
+ "@babel/plugin-transform-private-property-in-object": "^7.24.7",
26
+ "@babel/preset-env": "^7.25.4",
27
+ "@babel/preset-react": "^7.24.7",
28
+ "@babel/preset-typescript": "^7.24.7",
29
29
  "@peculiar/webcrypto": "^1.5.0",
30
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
31
30
  "@stanlemon/eslint-config": "*",
32
31
  "@testing-library/jest-dom": "^6.5.0",
33
- "@types/jest": "^29.5.13",
34
- "@types/react": "^18.3.11",
35
- "@types/react-dom": "^18.3.0",
36
- "@types/webpack": "^5.28.5",
37
- "@types/webpack-env": "^1.18.5",
38
32
  "babel-jest": "^29.7.0",
39
33
  "babel-loader": "^9.2.1",
40
- "clean-webpack-plugin": "^4.0.0",
41
34
  "css-loader": "^7.1.2",
42
35
  "dotenv": "^16.4.5",
43
36
  "html-webpack-plugin": "^5.6.0",
@@ -49,13 +42,17 @@
49
42
  "react-refresh": "^0.14.2",
50
43
  "style-loader": "^4.0.0",
51
44
  "typescript": "^5.6.2",
52
- "webpack": "^5.95.0",
45
+ "webpack": "^5.94.0",
53
46
  "webpack-bundle-analyzer": "^4.10.2",
54
47
  "webpack-cli": "^5.1.4",
55
48
  "webpack-dev-server": "^5.1.0"
56
49
  },
57
50
  "devDependencies": {
51
+ "@types/jest": "^29.5.13",
52
+ "@types/react": "^18.3.8",
58
53
  "@types/react-dom": "^18.3.0",
54
+ "@types/webpack": "^5.28.5",
55
+ "@types/webpack-env": "^1.18.5",
59
56
  "react": "^18.3.1",
60
57
  "react-dom": "^18.3.1"
61
58
  },
package/webpack.config.js CHANGED
@@ -2,9 +2,7 @@ const path = require("path");
2
2
  const { existsSync } = require("fs");
3
3
  const webpack = require("webpack");
4
4
  const HtmlWebpackPlugin = require("html-webpack-plugin");
5
- const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
6
5
  const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
7
- const { CleanWebpackPlugin } = require("clean-webpack-plugin");
8
6
  const { config } = require("dotenv");
9
7
 
10
8
  config();
@@ -35,15 +33,18 @@ const WEBDEV_PROXY = process.env.WEBDEV_PROXY ?? "";
35
33
  const WEBPACK_PUBLIC_PATH = process.env.WEBPACK_PUBLIC_PATH ?? "/";
36
34
  const NODE_ENV = process.env.NODE_ENV ?? "development";
37
35
 
38
- const proxy = {};
39
- WEBDEV_PROXY.split(";").forEach((entry) => {
40
- if (entry.indexOf("@") === -1) {
41
- return;
42
- }
43
- const path = entry.substring(0, entry.indexOf("@"));
44
- const host = entry.substring(entry.indexOf("@") + 1);
45
- proxy[path] = host;
46
- });
36
+ const proxy = WEBDEV_PROXY.split(";")
37
+ .map((entry) => {
38
+ if (entry.indexOf("@") === -1) {
39
+ return null;
40
+ }
41
+ const path = entry.substring(0, entry.indexOf("@"));
42
+ const host = entry.substring(entry.indexOf("@") + 1);
43
+
44
+ return { context: [path], target: host };
45
+ })
46
+ // Remove any nulls
47
+ .filter((e) => e !== null);
47
48
 
48
49
  const isDevelopment = NODE_ENV !== "production";
49
50
 
@@ -51,6 +52,7 @@ module.exports = {
51
52
  mode: isDevelopment ? "development" : "production",
52
53
  entry: WEBDEV_ENTRY.split(";"),
53
54
  output: {
55
+ clean: true,
54
56
  filename: "static/[name].[contenthash].js",
55
57
  path: path.resolve("./", "dist"),
56
58
  publicPath: WEBPACK_PUBLIC_PATH,
@@ -101,7 +103,6 @@ module.exports = {
101
103
  loader: "babel-loader",
102
104
  options: {
103
105
  ...babelOptions,
104
- plugins: [isDevelopment && "react-refresh/babel"].filter(Boolean),
105
106
  },
106
107
  },
107
108
  resolve: {
@@ -129,7 +130,6 @@ module.exports = {
129
130
  },
130
131
  plugins: [
131
132
  ...[
132
- new CleanWebpackPlugin(),
133
133
  ...WEBDEV_HTML.split(";").map((html) => {
134
134
  let inject = true;
135
135
  if (html.substring(0, 1) === "!") {
@@ -154,6 +154,5 @@ module.exports = {
154
154
  openAnalyzer: false,
155
155
  }),
156
156
  ].filter(Boolean),
157
- ...[isDevelopment && new ReactRefreshWebpackPlugin()].filter(Boolean),
158
157
  ],
159
158
  };