@stanlemon/webdev 0.1.200 → 0.2.0
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/eslint.config.js +1 -0
- package/jest.config.js +5 -6
- package/jest.setup.js +1 -1
- package/package.json +5 -3
- package/tsconfig.json +2 -2
- package/webpack.config.js +20 -19
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -5
package/eslint.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@stanlemon/eslint-config";
|
package/jest.config.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const babelOptions = require("./.babelrc.json");
|
|
1
|
+
import path from "path";
|
|
2
|
+
import babelOptions from "./.babelrc.json" assert { type: "json" };
|
|
4
3
|
|
|
5
4
|
// Disable using esmodules everywhere
|
|
6
5
|
babelOptions.presets.find(
|
|
@@ -19,9 +18,9 @@ const esModules = [
|
|
|
19
18
|
"@stanlemon/server-with-auth",
|
|
20
19
|
].join("|");
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
export default {
|
|
23
22
|
verbose: true,
|
|
24
|
-
setupFilesAfterEnv: [path.resolve(
|
|
23
|
+
setupFilesAfterEnv: [path.resolve(import.meta.dirname, "./jest.setup.js")],
|
|
25
24
|
testEnvironment: "jsdom",
|
|
26
25
|
transform: {
|
|
27
26
|
"^.+\\.(js|jsx|ts|tsx)?$": ["babel-jest", babelOptions],
|
|
@@ -32,7 +31,7 @@ module.exports = {
|
|
|
32
31
|
moduleNameMapper: {
|
|
33
32
|
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
|
|
34
33
|
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
|
|
35
|
-
uuid:
|
|
34
|
+
"^uuid$": "uuid",
|
|
36
35
|
},
|
|
37
36
|
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
|
|
38
37
|
coverageDirectory: "coverage",
|
package/jest.setup.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanlemon/webdev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "My typical web development setup, but without all the copy and paste.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=20.0"
|
|
15
15
|
},
|
|
16
|
-
"type": "
|
|
16
|
+
"type": "module",
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "WEBDEV_ENTRY=./example.tsx webpack build",
|
|
19
19
|
"lint": "eslint .",
|
|
20
|
-
"lint:fix": "eslint --fix ."
|
|
20
|
+
"lint:fix": "eslint --fix .",
|
|
21
|
+
"test": "jest",
|
|
22
|
+
"tsc": "tsc"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
25
|
"@babel/cli": "^7.25.6",
|
package/tsconfig.json
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"forceConsistentCasingInFileNames": true,
|
|
16
16
|
"noFallthroughCasesInSwitch": true,
|
|
17
17
|
"noImplicitAny": true,
|
|
18
|
-
"module": "
|
|
19
|
-
"moduleResolution": "
|
|
18
|
+
"module": "es2015",
|
|
19
|
+
"moduleResolution": "bundler",
|
|
20
20
|
"resolveJsonModule": true,
|
|
21
21
|
"isolatedModules": true,
|
|
22
22
|
"jsx": "react-jsx"
|
package/webpack.config.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import webpack from "webpack";
|
|
4
|
+
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
5
|
+
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
|
|
6
|
+
import { config } from "dotenv";
|
|
7
|
+
import babelOptions from "./.babelrc.json" assert { type: "json" };
|
|
7
8
|
|
|
8
9
|
config();
|
|
9
10
|
|
|
10
|
-
const babelOptions = require("./.babelrc.json");
|
|
11
|
-
|
|
12
11
|
function getWebdevEntry() {
|
|
13
12
|
if (process.env.WEBDEV_ENTRY) {
|
|
14
13
|
return process.env.WEBDEV_ENTRY;
|
|
@@ -33,19 +32,22 @@ const WEBDEV_PROXY = process.env.WEBDEV_PROXY ?? "";
|
|
|
33
32
|
const WEBPACK_PUBLIC_PATH = process.env.WEBPACK_PUBLIC_PATH ?? "/";
|
|
34
33
|
const NODE_ENV = process.env.NODE_ENV ?? "development";
|
|
35
34
|
|
|
36
|
-
const proxy =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
35
|
+
const proxy = WEBDEV_PROXY.split(";")
|
|
36
|
+
.map((entry) => {
|
|
37
|
+
if (entry.indexOf("@") === -1) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const path = entry.substring(0, entry.indexOf("@"));
|
|
41
|
+
const host = entry.substring(entry.indexOf("@") + 1);
|
|
42
|
+
|
|
43
|
+
return { context: [path], target: host };
|
|
44
|
+
})
|
|
45
|
+
// Remove any nulls
|
|
46
|
+
.filter((e) => e !== null);
|
|
45
47
|
|
|
46
48
|
const isDevelopment = NODE_ENV !== "production";
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
export default {
|
|
49
51
|
mode: isDevelopment ? "development" : "production",
|
|
50
52
|
entry: WEBDEV_ENTRY.split(";"),
|
|
51
53
|
output: {
|
|
@@ -100,7 +102,6 @@ module.exports = {
|
|
|
100
102
|
loader: "babel-loader",
|
|
101
103
|
options: {
|
|
102
104
|
...babelOptions,
|
|
103
|
-
plugins: [isDevelopment && "react-refresh/babel"].filter(Boolean),
|
|
104
105
|
},
|
|
105
106
|
},
|
|
106
107
|
resolve: {
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dist/**
|