canopy-webpack-config 4.4.3 → 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.3",
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"))) {
@@ -34,6 +36,11 @@ const externalPatterns = [
34
36
  /^react\/lib.*/,
35
37
  /^react$/,
36
38
  /^rxjs\/?.*$/,
39
+ // Built out of the common-dependencies repo rather than npm. They keep their bare
40
+ // specifiers under ESM, same as under SystemJS, so consuming source needs no edit —
41
+ // online-listener in particular owns a singleton observable that must not be duplicated.
42
+ /^online-listener$/,
43
+ /^cp-analytics$/,
37
44
  /^single-spa-canopy$/,
38
45
  /^single-spa$/,
39
46
  /^@canopytax\//,
@@ -98,7 +105,6 @@ export default function (name, overridesConfig = {}, options = {}) {
98
105
  optimization: {
99
106
  runtimeChunk: false,
100
107
  splitChunks: { chunks: "async" },
101
- minimize: false,
102
108
  },
103
109
 
104
110
  externalsType: "module",
@@ -123,20 +129,7 @@ export default function (name, overridesConfig = {}, options = {}) {
123
129
  {
124
130
  test: /\.(js|jsx|ts|tsx)$/,
125
131
  exclude: /node_modules/,
126
- use: {
127
- loader: "babel-loader",
128
- options: {
129
- presets: [
130
- [
131
- "@babel/preset-env",
132
- { targets: "defaults", modules: false },
133
- ],
134
- ["@babel/preset-react", { runtime: "automatic" }],
135
- "@babel/preset-typescript",
136
- ],
137
- plugins: ["@babel/plugin-transform-runtime"],
138
- },
139
- },
132
+ use: "babel-loader",
140
133
  },
141
134
  ],
142
135
  },
@@ -160,23 +153,13 @@ export default function (name, overridesConfig = {}, options = {}) {
160
153
  ? {
161
154
  host,
162
155
  port,
163
- server: (() => {
164
- const sslPath = path.join(homedir(), ".canopy-ssl");
165
- const keyPath = path.join(sslPath, "key.pem");
166
- const certPath = path.join(sslPath, "public.pem");
167
-
168
- if (fs.existsSync(keyPath) && fs.existsSync(certPath)) {
169
- return {
170
- type: "https",
171
- options: {
172
- key: fs.readFileSync(keyPath),
173
- cert: fs.readFileSync(certPath),
174
- // http2: true, // optional
175
- },
176
- };
177
- }
178
- return { type: "http" };
179
- })(),
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
+ },
180
163
  headers: {
181
164
  "Access-Control-Allow-Origin": "*",
182
165
  "Access-Control-Allow-Methods":
@@ -187,8 +170,14 @@ export default function (name, overridesConfig = {}, options = {}) {
187
170
  },
188
171
  allowedHosts: "all",
189
172
  hot: false,
190
- liveReload: false,
191
- 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
+ },
192
181
  }
193
182
  : undefined,
194
183
  };