piral-cli-webpack5 1.0.2 → 1.1.0-beta.5752

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/lib/helpers.js CHANGED
@@ -5,15 +5,20 @@ const fs_1 = require("fs");
5
5
  function extendConfig([webPackConfig, enhancer], otherConfigPath, overrides = {}) {
6
6
  const original = webPackConfig;
7
7
  if ((0, fs_1.existsSync)(otherConfigPath)) {
8
- const otherConfig = require(otherConfigPath);
9
- if (typeof otherConfig === 'function') {
10
- webPackConfig = otherConfig(webPackConfig);
8
+ try {
9
+ const otherConfig = require(otherConfigPath);
10
+ if (typeof otherConfig === 'function') {
11
+ webPackConfig = otherConfig(webPackConfig);
12
+ }
13
+ else if (typeof otherConfig === 'object') {
14
+ webPackConfig = Object.assign(Object.assign({}, webPackConfig), otherConfig);
15
+ }
16
+ else {
17
+ console.warn(`Did not recognize the export from "${otherConfigPath}". Skipping.`);
18
+ }
11
19
  }
12
- else if (typeof otherConfig === 'object') {
13
- webPackConfig = Object.assign(Object.assign({}, webPackConfig), otherConfig);
14
- }
15
- else {
16
- console.warn(`Did not recognize the export from "${otherConfigPath}". Skipping.`);
20
+ catch (ex) {
21
+ console.error(`Error while using the config from "${otherConfigPath}": ${ex}`);
17
22
  }
18
23
  }
19
24
  ['entry', 'output', 'optimization'].forEach((s) => {
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,2BAAgC;AAIhC,SAAgB,YAAY,CAC1B,CAAC,aAAa,EAAE,QAAQ,CAAuB,EAC/C,eAAuB,EACvB,YAA2B,EAAE;IAE7B,MAAM,QAAQ,GAAG,aAAa,CAAC;IAE/B,IAAI,IAAA,eAAU,EAAC,eAAe,CAAC,EAAE;QAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAE7C,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;YACrC,aAA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,MAAM,EAAE,EAAE,CAAC,CAAC;SAChF;KACF;IAED,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QAChD,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE;YACpC,OAAO,CAAC,IAAI,CACV,2BAA2B,CAAC,yEAAyE,CACtG,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,iCACV,aAAa,GACb,SAAS,EACZ,CAAC;AACL,CAAC;AAtCD,oCAsCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-cli-webpack5",
3
- "version": "1.0.2",
3
+ "version": "1.1.0-beta.5752",
4
4
  "description": "Provides debug and build capabilities for pilets and Piral instances using Webpack v5.",
5
5
  "keywords": [
6
6
  "piral-cli",
@@ -49,7 +49,7 @@
49
49
  "@types/node": "18.0.1",
50
50
  "@types/terser-webpack-plugin": "^5.2.0",
51
51
  "@types/yargs": "^15.0.4",
52
- "piral-cli": "^1.0.2",
52
+ "piral-cli": "1.1.0-beta.5752",
53
53
  "strip-ansi": "^6.0.0"
54
54
  },
55
55
  "dependencies": {
@@ -76,5 +76,5 @@
76
76
  "ts-loader": "^9.4.2",
77
77
  "webpack": "^5.82.1"
78
78
  },
79
- "gitHead": "bdbff29e39799a4472567f49692f2dd46b29e99d"
79
+ "gitHead": "a25a97f00b21282f33439320bef90ccbcc27ee96"
80
80
  }
package/src/helpers.ts CHANGED
@@ -10,17 +10,21 @@ export function extendConfig(
10
10
  const original = webPackConfig;
11
11
 
12
12
  if (existsSync(otherConfigPath)) {
13
- const otherConfig = require(otherConfigPath);
13
+ try {
14
+ const otherConfig = require(otherConfigPath);
14
15
 
15
- if (typeof otherConfig === 'function') {
16
- webPackConfig = otherConfig(webPackConfig);
17
- } else if (typeof otherConfig === 'object') {
18
- webPackConfig = {
19
- ...webPackConfig,
20
- ...otherConfig,
21
- };
22
- } else {
23
- console.warn(`Did not recognize the export from "${otherConfigPath}". Skipping.`);
16
+ if (typeof otherConfig === 'function') {
17
+ webPackConfig = otherConfig(webPackConfig);
18
+ } else if (typeof otherConfig === 'object') {
19
+ webPackConfig = {
20
+ ...webPackConfig,
21
+ ...otherConfig,
22
+ };
23
+ } else {
24
+ console.warn(`Did not recognize the export from "${otherConfigPath}". Skipping.`);
25
+ }
26
+ } catch (ex) {
27
+ console.error(`Error while using the config from "${otherConfigPath}": ${ex}`);
24
28
  }
25
29
  }
26
30