@soleil-se/build-app 2.5.2 → 2.5.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ title: Changelog
4
4
 
5
5
  Baseras på [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) och använder [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [2.5.3] - 2025-02-06
8
+
9
+ - Kasta fel vid dynamiska importer då dessa inte stöds i Rhino.
10
+
7
11
  ## [2.5.2] - 2025-01-22
8
12
 
9
13
  - Använd den fördefinierade inställningen `browser` för klientkod vid module resolution med `@rollup/plugin-node-resolve`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soleil-se/build-app",
3
3
  "description": "Script for building WebApps, RESTApps and Widgets with Svelte in Sitevision.",
4
- "version": "2.5.2",
4
+ "version": "2.5.3",
5
5
  "bin": {
6
6
  "build-app": "./bin/index.js",
7
7
  "sv-app-build": "./bin/index.js"
@@ -17,8 +17,7 @@ export function getReplaceServerPlugin() {
17
17
  "typeof process !== 'undefined' ? process.server : typeof window === 'undefined'": true,
18
18
  'process.server': true,
19
19
  'process.browser': false,
20
- 'import(\'node:crypto\')': null,
21
- 'import("node:crypto")': null,
20
+ 'import(': 'dynamicImportError(',
22
21
  preventAssignment: true,
23
22
  delimiters: ['', ''],
24
23
  });
package/rollup/server.js CHANGED
@@ -60,7 +60,16 @@ export default function rollupServer({
60
60
  bundleCache = cache && bundle.cache;
61
61
  return bundle.write({
62
62
  file: output,
63
- intro: 'var Promise = Promise || { resolve: () => {} }; var global = global || this; var self = self || global; var globalThis = globalThis || global; var setTimeout = setTimeout || function(cb) { cb() };',
63
+ intro: /* js */`
64
+ var Promise = Promise || { resolve: () => {} };
65
+ var global = global || this;
66
+ var self = self || global;
67
+ var globalThis = globalThis || global;
68
+ var setTimeout = setTimeout || function(cb) { cb() };
69
+ function dynamicImportError(moduleName) {
70
+ throw new Error('The module "' + moduleName + '" tried to be dynamically imported with "import", this is not supported in Rhino.');
71
+ }
72
+ `,
64
73
  format: 'iife',
65
74
  });
66
75
  } catch (e) {