@stanlemon/webdev 0.1.5 → 0.1.9
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/jest.config.js +11 -0
- package/package.json +1 -2
- package/webpack.config.js +15 -1
package/jest.config.js
CHANGED
|
@@ -19,4 +19,15 @@ export default {
|
|
|
19
19
|
moduleNameMapper: {
|
|
20
20
|
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
|
|
21
21
|
},
|
|
22
|
+
coverageDirectory: ".coverage",
|
|
23
|
+
coverageReporters: ["json", "lcov", "text", "html"],
|
|
24
|
+
collectCoverageFrom: ["**/*.{js,jsx,ts,tsx}"],
|
|
25
|
+
coveragePathIgnorePatterns: [
|
|
26
|
+
// Ignore all of our dependencies
|
|
27
|
+
"/node_modules/",
|
|
28
|
+
// Ignore coverage files
|
|
29
|
+
"\\.coverage\\/",
|
|
30
|
+
// Ignore config files
|
|
31
|
+
"\\.config\\.js$",
|
|
32
|
+
],
|
|
22
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stanlemon/webdev",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "My typical web development setup, but without all the copy and paste.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"react-refresh": "^0.11.0",
|
|
50
50
|
"style-loader": "^3.3.1",
|
|
51
51
|
"typescript": "^4.5.4",
|
|
52
|
-
"url-loader": "^4.1.1",
|
|
53
52
|
"webpack": "^5.65.0",
|
|
54
53
|
"webpack-bundle-analyzer": "^4.5.0",
|
|
55
54
|
"webpack-cli": "^4.9.1",
|
package/webpack.config.js
CHANGED
|
@@ -19,8 +19,21 @@ const WEBDEV_ENTRY = process.env.WEBDEV_ENTRY ?? "./src/index.tsx";
|
|
|
19
19
|
// If you prefix a page with a ! it will disable script injection
|
|
20
20
|
// The filename from the supplied path is used as the filename of the resulting file
|
|
21
21
|
const WEBDEV_HTML = process.env.WEBDEV_HTML ?? "./index.html";
|
|
22
|
+
// Proxy path's can be designated as path@host, separated by semi-colons
|
|
23
|
+
// For example /api@http://localhost:3000;/auth@http://localhost:4000
|
|
24
|
+
const WEBDEV_PROXY = process.env.WEBDEV_PROXY ?? "";
|
|
22
25
|
const NODE_ENV = process.env.NODE_ENV ?? "development";
|
|
23
26
|
|
|
27
|
+
const proxy = {};
|
|
28
|
+
WEBDEV_PROXY.split(";").forEach((entry) => {
|
|
29
|
+
if (entry.indexOf("@") === -1) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const path = entry.substring(0, entry.indexOf("@"));
|
|
33
|
+
const host = entry.substring(entry.indexOf("@") + 1);
|
|
34
|
+
proxy[path] = host;
|
|
35
|
+
});
|
|
36
|
+
|
|
24
37
|
const isDevelopment = NODE_ENV !== "production";
|
|
25
38
|
|
|
26
39
|
export default {
|
|
@@ -34,6 +47,7 @@ export default {
|
|
|
34
47
|
devServer: {
|
|
35
48
|
hot: true,
|
|
36
49
|
historyApiFallback: true,
|
|
50
|
+
proxy,
|
|
37
51
|
},
|
|
38
52
|
optimization: {
|
|
39
53
|
moduleIds: "deterministic",
|
|
@@ -88,7 +102,7 @@ export default {
|
|
|
88
102
|
},
|
|
89
103
|
{
|
|
90
104
|
test: /\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/i,
|
|
91
|
-
|
|
105
|
+
type: "asset/resource",
|
|
92
106
|
},
|
|
93
107
|
],
|
|
94
108
|
},
|