@openremote/util 1.30.0-snapshot.20260902122509 → 1.30.1

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/package.json +1 -1
  2. package/rspack.util.js +27 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openremote/util",
3
- "version": "1.30.0-snapshot.20260902122509",
3
+ "version": "1.30.1",
4
4
  "description": "Build Util",
5
5
  "author": "OpenRemote",
6
6
  "main": "rspack.util.js",
package/rspack.util.js CHANGED
@@ -33,6 +33,11 @@ function getStandardModuleRules() {
33
33
  test: /\.wasm$/,
34
34
  type: "asset/resource",
35
35
  },
36
+ {
37
+ // maplibre builds its worker URL at runtime, so its own `new URL()` calls are not build time assets
38
+ test: /maplibre-gl[\\/]dist[\\/].+\.mjs$/,
39
+ parser: { url: false },
40
+ },
36
41
  {
37
42
  test: /\.css$/, //
38
43
  exclude: /(maplibre|@material|gridstack|@mdi).*\.css$/,
@@ -60,6 +65,14 @@ function getStandardModuleRules() {
60
65
  };
61
66
  }
62
67
 
68
+ function resolveDir(request, dirname) {
69
+ try {
70
+ return path.dirname(require.resolve(request, { paths: [dirname] }));
71
+ } catch {
72
+ return undefined;
73
+ }
74
+ }
75
+
63
76
  function getAppConfig(mode, isDevServer, dirname, managerUrl, keycloakUrl, port) {
64
77
  const production = mode === "production";
65
78
  port = port || 9000;
@@ -84,7 +97,7 @@ function getAppConfig(mode, isDevServer, dirname, managerUrl, keycloakUrl, port)
84
97
  bundle: "./src/index.ts",
85
98
  },
86
99
  output: {
87
- path: dirname + "/dist",
100
+ path: dirname + "/build/dist",
88
101
  publicPath: isDevServer ? "/" + dirname.split(path.sep).slice(-1)[0] + "/" : "./",
89
102
  filename: production ? "[name].[contenthash].js" : "[name].js",
90
103
  },
@@ -192,6 +205,18 @@ function getAppConfig(mode, isDevServer, dirname, managerUrl, keycloakUrl, port)
192
205
  toType: "file",
193
206
  });
194
207
  }
208
+ // Check if maplibre is installed, its worker imports the shared module so both must sit side by side
209
+ const maplibreDist = resolveDir("maplibre-gl/dist/maplibre-gl-worker.mjs", dirname);
210
+ if (maplibreDist) {
211
+ for (const file of ["maplibre-gl-worker.mjs", "maplibre-gl-shared.mjs"]) {
212
+ patterns.push({
213
+ from: path.join(maplibreDist, file),
214
+ to: "maplibre",
215
+ toType: "dir",
216
+ info: { minimized: true },
217
+ });
218
+ }
219
+ }
195
220
 
196
221
  // Copy unprocessed files
197
222
  config.plugins.push(
@@ -275,7 +300,7 @@ function generateExports(dirname) {
275
300
  mode: "production",
276
301
  output: {
277
302
  filename: "[name].js",
278
- path: path.resolve(dirname, "dist/umd"),
303
+ path: path.resolve(dirname, "build/dist/umd"),
279
304
  library: {
280
305
  name: libName,
281
306
  target: "umd",