canopy-webpack-config 4.4.4 → 4.4.5

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/.yarnrc.yml CHANGED
@@ -4,4 +4,15 @@ enableGlobalCache: false
4
4
 
5
5
  nodeLinker: node-modules
6
6
 
7
- yarnPath: .yarn/releases/yarn-4.10.3.cjs
7
+ npmMinimalAgeGate: 7d
8
+
9
+ npmPreapprovedPackages:
10
+ - "@canopytax/*"
11
+ - browserslist-config-canopy
12
+ - canopy-webpack-config
13
+ - eslint-config-canopy
14
+ - kremling
15
+ - single-spa
16
+ - single-spa-canopy
17
+
18
+ yarnPath: .yarn/releases/yarn-4.14.1.cjs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canopy-webpack-config",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
4
4
  "description": "Some defaults for webpack configs at canopy",
5
5
  "main": "src/canopy-webpack-config.js",
6
6
  "exports": {
@@ -22,5 +22,5 @@
22
22
  "webpack-bundle-analyzer": "^4.7.0",
23
23
  "webpack-merge": "^4.2.1"
24
24
  },
25
- "packageManager": "yarn@4.10.3"
25
+ "packageManager": "yarn@4.14.1"
26
26
  }
@@ -3,7 +3,9 @@ import { CleanWebpackPlugin } from "clean-webpack-plugin";
3
3
  import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
4
4
  import merge from "webpack-merge";
5
5
  import fs from "fs";
6
- import { homedir } from "os";
6
+ import os from "os";
7
+
8
+ const homedir = os.homedir();
7
9
 
8
10
  let isDevServer = false;
9
11
  if (process.argv.some((arg) => arg.includes("serve"))) {
@@ -151,23 +153,13 @@ export default function (name, overridesConfig = {}, options = {}) {
151
153
  ? {
152
154
  host,
153
155
  port,
154
- server: (() => {
155
- const sslPath = path.join(homedir(), ".canopy-ssl");
156
- const keyPath = path.join(sslPath, "key.pem");
157
- const certPath = path.join(sslPath, "public.pem");
158
-
159
- if (fs.existsSync(keyPath) && fs.existsSync(certPath)) {
160
- return {
161
- type: "https",
162
- options: {
163
- key: fs.readFileSync(keyPath),
164
- cert: fs.readFileSync(certPath),
165
- // http2: true, // optional
166
- },
167
- };
168
- }
169
- return { type: "http" };
170
- })(),
156
+ server: {
157
+ type: "https",
158
+ options: {
159
+ cert: fs.readFileSync(`${homedir}/.canopy-ssl/public.pem`),
160
+ key: fs.readFileSync(`${homedir}/.canopy-ssl/key.pem`),
161
+ },
162
+ },
171
163
  headers: {
172
164
  "Access-Control-Allow-Origin": "*",
173
165
  "Access-Control-Allow-Methods":
@@ -178,8 +170,14 @@ export default function (name, overridesConfig = {}, options = {}) {
178
170
  },
179
171
  allowedHosts: "all",
180
172
  hot: false,
181
- liveReload: false,
182
- client: false,
173
+ liveReload: true,
174
+ client: {
175
+ webSocketURL: {
176
+ protocol: "wss",
177
+ hostname: host === "0.0.0.0" ? "localhost" : host, // Use localhost for the socket connection for CSP purposes
178
+ port,
179
+ },
180
+ },
183
181
  }
184
182
  : undefined,
185
183
  };