@ixon-cdk/static-builder 1.27.0-next.0 → 1.28.0-next.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.
Files changed (2) hide show
  1. package/browser.js +25 -10
  2. package/package.json +2 -2
package/browser.js CHANGED
@@ -48,27 +48,30 @@ async function _build(
48
48
  };
49
49
 
50
50
  // build
51
- process.on('uncaughtException', e => {
52
- console.error(e);
51
+ process.on('uncaughtException', error => {
52
+ logBuildError(error);
53
53
  });
54
54
 
55
55
  if (!watch) {
56
56
  try {
57
- await build(config).catch(() => process.exit(1));
57
+ await build(config);
58
58
  copyAssets(assets, inputDir, outputDir);
59
- } catch (e) {
60
- console.error(e);
59
+ } catch (error) {
60
+ logBuildError(error);
61
+ process.exit(1);
61
62
  }
62
63
  }
63
64
 
64
65
  // watch source files
65
66
  if (watch) {
66
67
  watchAssets(assets, inputDir, outputDir);
67
- watchInputDir(inputDir, isAsset => {
68
- if (isAsset) {
69
- // do nothing
70
- } else {
71
- build(config);
68
+ watchInputDir(inputDir, async isAsset => {
69
+ if (!isAsset) {
70
+ try {
71
+ await build(config);
72
+ } catch (error) {
73
+ logBuildError(error);
74
+ }
72
75
  }
73
76
  });
74
77
  process.on('SIGINT', () => {
@@ -77,6 +80,18 @@ async function _build(
77
80
  }
78
81
  }
79
82
 
83
+ function logBuildError(error) {
84
+ const message = error?.stack || error?.message || String(error);
85
+
86
+ if (message) {
87
+ console.error('\n' + message);
88
+ }
89
+
90
+ if (error.frame) {
91
+ console.error('\n' + error.frame);
92
+ }
93
+ }
94
+
80
95
  export default function runBuild(
81
96
  inputFile,
82
97
  outputFile,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixon-cdk/static-builder",
3
- "version": "1.27.0-next.0",
3
+ "version": "1.28.0-next.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -14,6 +14,6 @@
14
14
  "vite": "^7.3.3"
15
15
  },
16
16
  "peerDependencies": {
17
- "@ixon-cdk/core": "^1.27.0-next.0"
17
+ "@ixon-cdk/core": "^1.28.0-next.0"
18
18
  }
19
19
  }