@skyvexsoftware/stratos-sdk 0.1.9 → 0.1.10
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.
|
@@ -6,7 +6,7 @@ import type { PluginBackgroundModule } from "../types/module";
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
|
-
* import { createPlugin } from "@skyvexsoftware/stratos-sdk";
|
|
9
|
+
* import { createPlugin } from "@skyvexsoftware/stratos-sdk/helpers";
|
|
10
10
|
*
|
|
11
11
|
* export default createPlugin({
|
|
12
12
|
* async onStart(ctx) {
|
|
@@ -21,11 +21,7 @@ import { UI_EXTERNALS } from "./externals.js";
|
|
|
21
21
|
import { serveExternals } from "./serve-externals.js";
|
|
22
22
|
import { stratosDevServer } from "./stratos-dev-server.js";
|
|
23
23
|
/** Modules external in background builds (available in Electron main process) */
|
|
24
|
-
const BG_EXTERNALS = [
|
|
25
|
-
"electron",
|
|
26
|
-
"@skyvexsoftware/stratos-sdk",
|
|
27
|
-
"socket.io-client",
|
|
28
|
-
];
|
|
24
|
+
const BG_EXTERNALS = ["electron", "socket.io-client"];
|
|
29
25
|
/** Node.js built-in modules to externalize in background builds */
|
|
30
26
|
const NODE_BUILTINS = [
|
|
31
27
|
"assert",
|
|
@@ -238,11 +234,18 @@ function createBackgroundConfig(pluginDir, entry) {
|
|
|
238
234
|
fileName: () => "index.js",
|
|
239
235
|
},
|
|
240
236
|
rollupOptions: {
|
|
241
|
-
external:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
237
|
+
external: (id) => {
|
|
238
|
+
// Bundle the SDK helpers subpath (createPlugin) into the output
|
|
239
|
+
if (id === "@skyvexsoftware/stratos-sdk/helpers")
|
|
240
|
+
return false;
|
|
241
|
+
if (id === "@skyvexsoftware/stratos-sdk")
|
|
242
|
+
return true;
|
|
243
|
+
if (BG_EXTERNALS.some((ext) => id === ext || id.startsWith(`${ext}/`)))
|
|
244
|
+
return true;
|
|
245
|
+
if (NODE_BUILTINS.some((b) => id === b || id === `node:${b}`))
|
|
246
|
+
return true;
|
|
247
|
+
return false;
|
|
248
|
+
},
|
|
246
249
|
},
|
|
247
250
|
sourcemap: !isProduction,
|
|
248
251
|
minify: false,
|