@sigx/lynx-plugin 0.4.0 → 0.4.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.
- package/dist/css.js +150 -0
- package/dist/entry.js +443 -0
- package/dist/icons.js +226 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +395 -434
- package/dist/layers.js +5 -0
- package/dist/loaders/hmr-loader.js +70 -19
- package/dist/loaders/ignore-css-loader.js +16 -7
- package/dist/loaders/worklet-loader-mt.js +142 -62
- package/dist/loaders/worklet-loader.js +69 -31
- package/dist/loaders/worklet-utils.d.ts +0 -15
- package/dist/loaders/worklet-utils.js +116 -0
- package/dist/log-server.d.ts +0 -0
- package/dist/log-server.js +0 -0
- package/package.json +13 -11
- package/dist/index.js.map +0 -1
- package/dist/loaders/hmr-loader.js.map +0 -1
- package/dist/loaders/ignore-css-loader.js.map +0 -1
- package/dist/loaders/worklet-loader-mt.js.map +0 -1
- package/dist/loaders/worklet-loader.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,437 +1,398 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* An rsbuild / rspeedy plugin that integrates SignalX with Lynx's dual-thread
|
|
5
|
+
* architecture (Background Thread renderer + Main Thread PAPI executor).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* // lynx.config.ts
|
|
10
|
+
* import { defineConfig } from '@lynx-js/rspeedy'
|
|
11
|
+
* import { pluginSigxLynx } from '@sigx/lynx-plugin'
|
|
12
|
+
*
|
|
13
|
+
* export default defineConfig({
|
|
14
|
+
* plugins: [pluginSigxLynx()],
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import { networkInterfaces } from 'node:os';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
import { applyCSS } from './css.js';
|
|
22
|
+
import { applyEntry } from './entry.js';
|
|
23
|
+
import { applyIcons } from './icons.js';
|
|
24
|
+
import { LAYERS } from './layers.js';
|
|
25
|
+
import { createLogWebSocketServer, LOG_ENDPOINT_PATH } from './log-server.js';
|
|
26
|
+
export { LAYERS, applyEntry };
|
|
27
|
+
const _pluginDirname = path.dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const _sigxLynxRoot = path.resolve(_pluginDirname, '../..');
|
|
29
|
+
/** Wildcard addresses that bind to all interfaces but aren't routable from other devices. */
|
|
30
|
+
const WILDCARD_HOSTS = new Set(['0.0.0.0', '::', '0:0:0:0:0:0:0:0']);
|
|
31
|
+
/**
|
|
32
|
+
* Interface names that are virtual adapters (Hyper-V, WSL, Docker, VPN, etc.)
|
|
33
|
+
* and should be skipped when looking for the real LAN address.
|
|
34
|
+
*/
|
|
35
|
+
const VIRTUAL_IF_PATTERNS = /^(vEthernet|veth|docker|br-|virbr|vmnet|VirtualBox|Hyper-V|WSL|ham\d)/i;
|
|
36
|
+
/**
|
|
37
|
+
* Detect the real LAN IPv4 address on this machine.
|
|
38
|
+
* Skips virtual/container adapters (Hyper-V, WSL, Docker) and prefers
|
|
39
|
+
* physical interfaces like Wi-Fi or Ethernet.
|
|
40
|
+
* Falls back to the first external IPv4 if no physical match is found,
|
|
41
|
+
* and ultimately to `'127.0.0.1'`.
|
|
42
|
+
*/
|
|
43
|
+
function detectLanIPv4() {
|
|
44
|
+
const ifaces = networkInterfaces();
|
|
45
|
+
let fallback;
|
|
46
|
+
for (const [name, nets] of Object.entries(ifaces)) {
|
|
47
|
+
for (const net of nets ?? []) {
|
|
48
|
+
if (net.family !== 'IPv4' || net.internal || !net.address)
|
|
49
|
+
continue;
|
|
50
|
+
// Remember first external address as fallback
|
|
51
|
+
if (!fallback)
|
|
52
|
+
fallback = net.address;
|
|
53
|
+
// Skip virtual adapters
|
|
54
|
+
if (VIRTUAL_IF_PATTERNS.test(name))
|
|
55
|
+
continue;
|
|
56
|
+
return net.address;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return fallback ?? '127.0.0.1';
|
|
48
60
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
mode: t,
|
|
54
|
-
exportOnlyLocals: !0
|
|
55
|
-
} : {
|
|
56
|
-
...t,
|
|
57
|
-
exportOnlyLocals: !0
|
|
58
|
-
}, {
|
|
59
|
-
...e,
|
|
60
|
-
modules: t
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
return e;
|
|
64
|
-
}, f = "lynx:sigx-template", p = "lynx:sigx-mark-main-thread", m = "lynx:sigx-encode", h = ".rspeedy", g = t.dirname(r(import.meta.url));
|
|
65
|
-
t.resolve(g, "..");
|
|
66
|
-
var _ = class {
|
|
67
|
-
mainThreadFilenames;
|
|
68
|
-
constructor(e) {
|
|
69
|
-
this.mainThreadFilenames = e;
|
|
70
|
-
}
|
|
71
|
-
apply(e) {
|
|
72
|
-
let { RuntimeGlobals: t } = e.webpack;
|
|
73
|
-
e.hooks.thisCompilation.tap(p, (n) => {
|
|
74
|
-
n.hooks.additionalTreeRuntimeRequirements.tap(p, (e, n) => {
|
|
75
|
-
e.getEntryOptions()?.layer === c.MAIN_THREAD && (n.add(t.startup), n.add(t.require));
|
|
76
|
-
}), n.hooks.processAssets.tap({
|
|
77
|
-
name: p,
|
|
78
|
-
stage: e.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
|
|
79
|
-
}, () => {
|
|
80
|
-
for (let e of this.mainThreadFilenames) {
|
|
81
|
-
let t = n.getAsset(e);
|
|
82
|
-
t && n.updateAsset(e, t.source, {
|
|
83
|
-
...t.info,
|
|
84
|
-
"lynx:main-thread": !0
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
async function v(e, n = {}) {
|
|
92
|
-
let r;
|
|
93
|
-
try {
|
|
94
|
-
r = await import("@lynx-js/template-webpack-plugin");
|
|
95
|
-
} catch {}
|
|
96
|
-
let i;
|
|
97
|
-
try {
|
|
98
|
-
i = await import("@lynx-js/runtime-wrapper-webpack-plugin");
|
|
99
|
-
} catch {}
|
|
100
|
-
e.modifyRsbuildConfig((t, { mergeRsbuildConfig: n }) => e.getRsbuildConfig("original").performance?.chunkSplit?.strategy ? t : n(t, { performance: { chunkSplit: { strategy: "all-in-one" } } })), e.modifyRspackConfig((e) => {
|
|
101
|
-
if (!e.optimization) return e;
|
|
102
|
-
if (e.optimization.splitChunks === !1 && (e.optimization.splitChunks = {}), e.optimization.splitChunks) {
|
|
103
|
-
let t = e.optimization.splitChunks.chunks;
|
|
104
|
-
e.optimization.splitChunks.chunks = (e) => e.name?.includes("__main-thread") ? !1 : typeof t == "function" ? t(e) : t === "all" || t === "initial";
|
|
105
|
-
}
|
|
106
|
-
return e;
|
|
107
|
-
}), e.modifyBundlerChain((a, { environment: o, isProd: s }) => {
|
|
108
|
-
if (e.context.callerName !== "rspeedy") return;
|
|
109
|
-
let l = !s, u = o.name === "lynx" || o.name.startsWith("lynx-"), d = o.name === "web" || o.name.startsWith("web-"), { hmr: v, liveReload: y } = o.config.dev ?? {}, b = l && !d && v !== !1, x = l && !d && y !== !1, S = a.entryPoints.entries() ?? {};
|
|
110
|
-
a.entryPoints.clear();
|
|
111
|
-
let C = [];
|
|
112
|
-
for (let [e, i] of Object.entries(S)) {
|
|
113
|
-
let l = [], p = i;
|
|
114
|
-
for (let e of p.values()) if (typeof e == "string") l.push(e);
|
|
115
|
-
else if (typeof e == "object" && e && "import" in e) {
|
|
116
|
-
let t = e.import;
|
|
117
|
-
Array.isArray(t) ? l.push(...t) : t && l.push(t);
|
|
118
|
-
}
|
|
119
|
-
let m = u ? h : "", g = `${e}__main-thread`, _ = t.posix.join(m, `${e}/main-thread.js`), v = t.posix.join(m, `${e}/background${s ? ".[contenthash:8]" : ""}.js`);
|
|
120
|
-
(u || d) && C.push(_);
|
|
121
|
-
let y = b ? ["@lynx-js/css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs", ...l] : [...l];
|
|
122
|
-
a.entry(g).add({
|
|
123
|
-
layer: c.MAIN_THREAD,
|
|
124
|
-
import: y,
|
|
125
|
-
filename: _
|
|
126
|
-
}).end();
|
|
127
|
-
let S = [];
|
|
128
|
-
S.push(...l);
|
|
129
|
-
let w = a.entry(e).add({
|
|
130
|
-
layer: c.BACKGROUND,
|
|
131
|
-
import: S,
|
|
132
|
-
filename: v
|
|
133
|
-
});
|
|
134
|
-
if (b && (w.prepend({
|
|
135
|
-
layer: c.BACKGROUND,
|
|
136
|
-
import: "@rspack/core/hot/dev-server"
|
|
137
|
-
}), w.prepend({
|
|
138
|
-
layer: c.BACKGROUND,
|
|
139
|
-
import: "@sigx/lynx-runtime/mt-hmr-bridge"
|
|
140
|
-
})), (b || x) && w.prepend({
|
|
141
|
-
layer: c.BACKGROUND,
|
|
142
|
-
import: "@lynx-js/webpack-dev-transport/client"
|
|
143
|
-
}), w.end(), (u || d) && r) {
|
|
144
|
-
let { LynxTemplatePlugin: i } = r, s = (typeof o.config.output.filename == "object" ? o.config.output.filename.bundle : o.config.output.filename) ?? "[name].[platform].bundle";
|
|
145
|
-
a.plugin(`${f}-${e}`).use(i, [{
|
|
146
|
-
...i.defaultOptions,
|
|
147
|
-
dsl: "react_nodiff",
|
|
148
|
-
chunks: [g, e],
|
|
149
|
-
filename: s.replaceAll("[name]", e).replaceAll("[platform]", o.name),
|
|
150
|
-
intermediate: t.posix.join(m, e),
|
|
151
|
-
debugInfoOutside: n.debugInfoOutside ?? !0,
|
|
152
|
-
enableCSSSelector: n.enableCSSSelector ?? !0,
|
|
153
|
-
enableCSSInvalidation: n.enableCSSSelector ?? !0,
|
|
154
|
-
enableCSSInheritance: n.enableCSSInheritance ?? !1,
|
|
155
|
-
customCSSInheritanceList: n.customCSSInheritanceList,
|
|
156
|
-
enableRemoveCSSScope: !0,
|
|
157
|
-
enableNewGesture: !0,
|
|
158
|
-
removeDescendantSelectorScope: !0,
|
|
159
|
-
cssPlugins: []
|
|
160
|
-
}]).end();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if ((u || d) && C.length > 0 && a.plugin(p).use(_, [C]).end(), u && i) {
|
|
164
|
-
let { RuntimeWrapperWebpackPlugin: e } = i;
|
|
165
|
-
a.plugin("lynx:sigx-runtime-wrapper").use(e, [{ test: /^(?!.*main-thread(?:\.[A-Fa-f0-9]*)?\.js$).*\.js$/ }]).end();
|
|
166
|
-
}
|
|
167
|
-
if (u && r) {
|
|
168
|
-
let { LynxEncodePlugin: e } = r;
|
|
169
|
-
a.plugin(m).use(e, [{}]).end();
|
|
170
|
-
}
|
|
171
|
-
b && a.module.rule("sigx-hmr").test(/\.[jt]sx?$/).issuerLayer(c.BACKGROUND).exclude.add(/node_modules/).add(/dist/).end().enforce("pre").use("sigx-hmr-loader").loader(t.resolve(g, "./loaders/hmr-loader")).end(), a.module.rule("sigx-worklet").test(/\.[jt]sx?$/).issuerLayer(c.BACKGROUND).enforce("pre").use("sigx-worklet-loader").loader(t.resolve(g, "./loaders/worklet-loader")).end(), a.module.rule("sigx-worklet-mt").test(/\.[jt]sx?$/).issuerLayer(c.MAIN_THREAD).enforce("pre").use("sigx-worklet-mt-loader").loader(t.resolve(g, "./loaders/worklet-loader-mt")).end(), a.output.set("iife", !1);
|
|
172
|
-
});
|
|
61
|
+
/** Extract the hostname from a URL string (may be inside JSON quotes). */
|
|
62
|
+
function extractHost(s) {
|
|
63
|
+
const m = s.match(/\/\/([^:/]+)/);
|
|
64
|
+
return m ? m[1] : '';
|
|
173
65
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Create an rsbuild / rspeedy plugin for SignalX-Lynx dual-thread rendering.
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export function pluginSigxLynx(options = {}) {
|
|
72
|
+
const { enableCSSSelector: _enableCSSSelector = true, enableCSSInheritance: _enableCSSInheritance = false, customCSSInheritanceList: _customCSSInheritanceList, debugInfoOutside: _debugInfoOutside = true, } = options;
|
|
73
|
+
return {
|
|
74
|
+
name: 'lynx:sigx',
|
|
75
|
+
// Must run after rspeedy's own config plugins (including pluginDev for URL fixes)
|
|
76
|
+
pre: ['lynx:rsbuild:plugin-api', 'lynx:config', 'lynx:rsbuild:dev'],
|
|
77
|
+
async setup(api) {
|
|
78
|
+
api.modifyRsbuildConfig((config, { mergeRsbuildConfig }) => {
|
|
79
|
+
// Compile all JS files (including node_modules) for ES2019 compat
|
|
80
|
+
// with the Lynx JS engine, unless user explicitly sets source.include.
|
|
81
|
+
const userConfig = api.getRsbuildConfig('original');
|
|
82
|
+
if (typeof userConfig.source?.include === 'undefined') {
|
|
83
|
+
config = mergeRsbuildConfig(config, {
|
|
84
|
+
source: {
|
|
85
|
+
include: [/\.(?:js|mjs|cjs)$/],
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// Honour `SIGX_LYNX_DEV_PORT` set by `@sigx/lynx-cli`. Rspeedy's CLI
|
|
90
|
+
// has no `--port` flag, so the CLI plumbs its computed port (from
|
|
91
|
+
// `sigx dev --port N` or the lynx-cli default) through this env var
|
|
92
|
+
// and we override `server.port` here. Without this, `serverState.port`
|
|
93
|
+
// on the lynx-cli side (used to build the device-launch URL) could
|
|
94
|
+
// diverge from whatever the user's `lynx.config.ts` set — and the
|
|
95
|
+
// device would boot pointing at a server that isn't there.
|
|
96
|
+
const envPort = process.env['SIGX_LYNX_DEV_PORT'];
|
|
97
|
+
const portOverride = envPort && Number.isFinite(Number(envPort))
|
|
98
|
+
? Number(envPort)
|
|
99
|
+
: undefined;
|
|
100
|
+
if (portOverride !== undefined) {
|
|
101
|
+
config = mergeRsbuildConfig(config, {
|
|
102
|
+
server: { port: portOverride },
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return mergeRsbuildConfig(config, {
|
|
106
|
+
source: {
|
|
107
|
+
define: {
|
|
108
|
+
__DEV__: 'process.env.NODE_ENV !== \'production\'',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
tools: {
|
|
112
|
+
rspack: {
|
|
113
|
+
output: {
|
|
114
|
+
iife: false,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
swc: {
|
|
118
|
+
jsc: {
|
|
119
|
+
target: 'es2019',
|
|
120
|
+
transform: {
|
|
121
|
+
react: {
|
|
122
|
+
runtime: 'automatic',
|
|
123
|
+
importSource: '@sigx/lynx',
|
|
124
|
+
throwIfNamespace: false,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
// -------------------------------------------------------------------
|
|
133
|
+
// Dev-only: console log streaming. Two pieces:
|
|
134
|
+
// 1. `onAfterStartDevServer` boots a tiny `ws` server on
|
|
135
|
+
// `devServerPort + 1` that receives batched log entries from
|
|
136
|
+
// devices and emits them on stdout for the CLI to pretty-print.
|
|
137
|
+
// 2. `source.define` bakes the ws URL into the BG bundle so
|
|
138
|
+
// `@sigx/lynx-dev-client/install` can pick it up at runtime.
|
|
139
|
+
// Both are gated on NODE_ENV !== 'production'.
|
|
140
|
+
//
|
|
141
|
+
// The Lynx BG runtime on Android has no `fetch` / `XHR` / `lynx.fetch`,
|
|
142
|
+
// so HTTP isn't an option for the device side. WebSocket is shipped by
|
|
143
|
+
// `@sigx/lynx-websocket` (URLSessionWebSocketTask on iOS, OkHttp on
|
|
144
|
+
// Android), which the dev-client imports as a side-effect.
|
|
145
|
+
// -------------------------------------------------------------------
|
|
146
|
+
const isDevServer = process.env['NODE_ENV'] !== 'production';
|
|
147
|
+
if (isDevServer) {
|
|
148
|
+
const lanIP = detectLanIPv4();
|
|
149
|
+
let logServer;
|
|
150
|
+
let wsPort = 0;
|
|
151
|
+
api.modifyRsbuildConfig((config, { mergeRsbuildConfig }) => {
|
|
152
|
+
const envPort = process.env['SIGX_LYNX_DEV_PORT'];
|
|
153
|
+
const httpPort = envPort && Number.isFinite(Number(envPort))
|
|
154
|
+
? Number(envPort)
|
|
155
|
+
: (config.server?.port ?? 3000);
|
|
156
|
+
wsPort = httpPort + 1;
|
|
157
|
+
const logUrl = `ws://${lanIP}:${wsPort}${LOG_ENDPOINT_PATH}`;
|
|
158
|
+
return mergeRsbuildConfig(config, {
|
|
159
|
+
source: {
|
|
160
|
+
define: {
|
|
161
|
+
__SIGX_DEV_LOG_URL__: JSON.stringify(logUrl),
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
api.onAfterStartDevServer(async () => {
|
|
167
|
+
if (logServer)
|
|
168
|
+
return;
|
|
169
|
+
try {
|
|
170
|
+
logServer = await createLogWebSocketServer({ port: wsPort });
|
|
171
|
+
api.logger.info(`[sigx-lynx] device log ws → ws://${lanIP}:${logServer.port}${LOG_ENDPOINT_PATH}`);
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
api.logger.warn(`[sigx-lynx] device log ws failed to start on port ${wsPort}: ${err.message}`);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const stopLogServer = async () => {
|
|
178
|
+
if (!logServer)
|
|
179
|
+
return;
|
|
180
|
+
const s = logServer;
|
|
181
|
+
logServer = undefined;
|
|
182
|
+
await s.close();
|
|
183
|
+
};
|
|
184
|
+
api.onCloseDevServer(stopLogServer);
|
|
185
|
+
api.onExit(() => { void stopLogServer(); });
|
|
186
|
+
}
|
|
187
|
+
api.modifyBundlerChain((chain) => {
|
|
188
|
+
chain.resolve.alias.set('@sigx/runtime-dom', '@sigx/lynx-runtime');
|
|
189
|
+
});
|
|
190
|
+
// rspeedy's pluginDev uses `server.host` as the hostname for HMR
|
|
191
|
+
// client URLs (publicPath, WebSocket URL, printUrls). When the user
|
|
192
|
+
// sets server.host to '0.0.0.0' (bind all interfaces), those URLs
|
|
193
|
+
// become unreachable from external devices (phones, emulators).
|
|
194
|
+
//
|
|
195
|
+
// Fix at the rsbuild config level (runs AFTER rspeedy's hooks thanks
|
|
196
|
+
// to 'lynx:rsbuild:dev' in `pre`): replace wildcard hosts with the
|
|
197
|
+
// actual LAN IP in dev.assetPrefix, dev.client.host, output.assetPrefix,
|
|
198
|
+
// and the server.printUrls function.
|
|
199
|
+
api.modifyRsbuildConfig((config, { mergeRsbuildConfig }) => {
|
|
200
|
+
const devAssetPrefix = config.dev?.assetPrefix;
|
|
201
|
+
if (typeof devAssetPrefix !== 'string')
|
|
202
|
+
return config;
|
|
203
|
+
// Only fix if the assetPrefix contains a wildcard host
|
|
204
|
+
let needsFix = false;
|
|
205
|
+
for (const wh of WILDCARD_HOSTS) {
|
|
206
|
+
if (devAssetPrefix.includes(`//${wh}:`)) {
|
|
207
|
+
needsFix = true;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (!needsFix)
|
|
212
|
+
return config;
|
|
213
|
+
const lanIP = detectLanIPv4();
|
|
214
|
+
const replaceWildcard = (s) => {
|
|
215
|
+
for (const wh of WILDCARD_HOSTS) {
|
|
216
|
+
s = s.replaceAll(`//${wh}:`, `//${lanIP}:`);
|
|
217
|
+
}
|
|
218
|
+
return s;
|
|
219
|
+
};
|
|
220
|
+
const fixedAssetPrefix = replaceWildcard(devAssetPrefix);
|
|
221
|
+
// Override printUrls to show the correct LAN IP URL.
|
|
222
|
+
// rspeedy's printUrls uses closure variables that still hold '0.0.0.0',
|
|
223
|
+
// so we must replace the function entirely.
|
|
224
|
+
const existingPrintUrls = config.server?.printUrls;
|
|
225
|
+
const printUrlsFn = typeof existingPrintUrls === 'function'
|
|
226
|
+
? (param) => {
|
|
227
|
+
// Call rspeedy's original printUrls to get the URL list,
|
|
228
|
+
// then fix the hostnames in each URL.
|
|
229
|
+
const result = existingPrintUrls(param);
|
|
230
|
+
if (Array.isArray(result)) {
|
|
231
|
+
return result.map((item) => typeof item === 'string'
|
|
232
|
+
? replaceWildcard(item)
|
|
233
|
+
: { ...item, url: replaceWildcard(item.url) });
|
|
234
|
+
}
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
: undefined;
|
|
238
|
+
const merged = mergeRsbuildConfig(config, {
|
|
239
|
+
dev: {
|
|
240
|
+
assetPrefix: fixedAssetPrefix,
|
|
241
|
+
client: {
|
|
242
|
+
host: lanIP,
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
output: {
|
|
246
|
+
assetPrefix: fixedAssetPrefix,
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
// Direct assignment — mergeRsbuildConfig can't reliably merge functions
|
|
250
|
+
if (printUrlsFn) {
|
|
251
|
+
merged.server = { ...merged.server, printUrls: printUrlsFn };
|
|
252
|
+
}
|
|
253
|
+
return merged;
|
|
254
|
+
});
|
|
255
|
+
// Rspack's default watcher-ignore is only /node_modules|\.git/. In Lynx
|
|
256
|
+
// app layouts the ios/ Pods tree and dist/ output drown macOS FSEvents,
|
|
257
|
+
// causing edits to src/*.tsx to silently not fire rebuilds. Narrow the
|
|
258
|
+
// watched set and stop chasing symlinks through pnpm's .pnpm/ store.
|
|
259
|
+
//
|
|
260
|
+
// Upstream: fixed in Rspack 2.0 (`fix(watcher): filter stale FSEvents
|
|
261
|
+
// with mtime baseline comparison`). Rspeedy 0.14.2 still pins Rspack
|
|
262
|
+
// 1.7.10, so we can't adopt the real fix yet — revisit when rspeedy
|
|
263
|
+
// bumps to Rspack 2.0 and we can drop this hook.
|
|
264
|
+
api.modifyRspackConfig((rspackConfig) => {
|
|
265
|
+
const existing = rspackConfig.watchOptions ?? {};
|
|
266
|
+
const existingIgnored = Array.isArray(existing.ignored)
|
|
267
|
+
? existing.ignored
|
|
268
|
+
: typeof existing.ignored === 'string'
|
|
269
|
+
? [existing.ignored]
|
|
270
|
+
: [];
|
|
271
|
+
rspackConfig.watchOptions = {
|
|
272
|
+
...existing,
|
|
273
|
+
ignored: [
|
|
274
|
+
'**/node_modules/**',
|
|
275
|
+
'**/.git/**',
|
|
276
|
+
'**/dist/**',
|
|
277
|
+
'**/ios/**',
|
|
278
|
+
'**/android/**',
|
|
279
|
+
'**/Pods/**',
|
|
280
|
+
'**/.rspeedy/**',
|
|
281
|
+
...existingIgnored,
|
|
282
|
+
],
|
|
283
|
+
followSymlinks: existing.followSymlinks ?? false,
|
|
284
|
+
poll: existing.poll
|
|
285
|
+
?? (process.env.SIGX_LYNX_WATCH_POLL
|
|
286
|
+
? Number(process.env.SIGX_LYNX_WATCH_POLL) || true
|
|
287
|
+
: undefined),
|
|
288
|
+
};
|
|
289
|
+
});
|
|
290
|
+
// Belt-and-suspenders: also patch at the rspack config level in case
|
|
291
|
+
// the rsbuild-level fix didn't propagate everywhere (e.g. resolve
|
|
292
|
+
// aliases set by rspeedy's modifyBundlerChain using closure variables).
|
|
293
|
+
api.modifyRspackConfig((rspackConfig) => {
|
|
294
|
+
// Check if publicPath or any resolve alias contains a wildcard host
|
|
295
|
+
let needsFix = false;
|
|
296
|
+
const publicPath = rspackConfig.output?.publicPath;
|
|
297
|
+
if (typeof publicPath === 'string') {
|
|
298
|
+
for (const wh of WILDCARD_HOSTS) {
|
|
299
|
+
if (publicPath.includes(`//${wh}:`)) {
|
|
300
|
+
needsFix = true;
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (!needsFix) {
|
|
306
|
+
const aliases = rspackConfig.resolve?.alias;
|
|
307
|
+
if (aliases && typeof aliases === 'object' && !Array.isArray(aliases)) {
|
|
308
|
+
for (const val of Object.values(aliases)) {
|
|
309
|
+
if (typeof val === 'string') {
|
|
310
|
+
for (const wh of WILDCARD_HOSTS) {
|
|
311
|
+
if (val.includes(`hostname=${wh}`)) {
|
|
312
|
+
needsFix = true;
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (needsFix)
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (!needsFix)
|
|
323
|
+
return;
|
|
324
|
+
const lanIP = detectLanIPv4();
|
|
325
|
+
const replaceWildcard = (s) => {
|
|
326
|
+
for (const wh of WILDCARD_HOSTS) {
|
|
327
|
+
s = s.replaceAll(`//${wh}:`, `//${lanIP}:`);
|
|
328
|
+
s = s.replaceAll(`hostname=${wh}`, `hostname=${lanIP}`);
|
|
329
|
+
}
|
|
330
|
+
return s;
|
|
331
|
+
};
|
|
332
|
+
// Fix output.publicPath (used for hot-update fetch URLs)
|
|
333
|
+
if (rspackConfig.output) {
|
|
334
|
+
rspackConfig.output.publicPath = replaceWildcard(rspackConfig.output.publicPath);
|
|
335
|
+
}
|
|
336
|
+
// Fix the resolve alias for @lynx-js/webpack-dev-transport/client
|
|
337
|
+
// which embeds hostname=0.0.0.0 in query params for the WebSocket URL
|
|
338
|
+
const aliases = rspackConfig.resolve?.alias;
|
|
339
|
+
if (aliases && typeof aliases === 'object' && !Array.isArray(aliases)) {
|
|
340
|
+
for (const [key, val] of Object.entries(aliases)) {
|
|
341
|
+
if (typeof val === 'string') {
|
|
342
|
+
const fixed = replaceWildcard(val);
|
|
343
|
+
if (fixed !== val) {
|
|
344
|
+
aliases[key] = fixed;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
// Fix ASSET_PREFIX in DefinePlugin definitions — these are stringified
|
|
350
|
+
// JSON values so the wildcard appears inside quoted strings.
|
|
351
|
+
for (const plugin of rspackConfig.plugins ?? []) {
|
|
352
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
353
|
+
const defs = plugin?.definitions ?? plugin?._args?.[0];
|
|
354
|
+
if (!defs || typeof defs !== 'object')
|
|
355
|
+
continue;
|
|
356
|
+
for (const [k, v] of Object.entries(defs)) {
|
|
357
|
+
if (typeof v === 'string' && WILDCARD_HOSTS.has(extractHost(v))) {
|
|
358
|
+
defs[k] = replaceWildcard(v);
|
|
359
|
+
}
|
|
360
|
+
else if (typeof v === 'object' && v !== null) {
|
|
361
|
+
for (const [k2, v2] of Object.entries(v)) {
|
|
362
|
+
if (typeof v2 === 'string' && WILDCARD_HOSTS.has(extractHost(v2))) {
|
|
363
|
+
v[k2] = replaceWildcard(v2);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
// Fix SourceMapDevToolPlugin publicPath
|
|
370
|
+
for (const plugin of rspackConfig.plugins ?? []) {
|
|
371
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
372
|
+
const opts = plugin?._options ?? plugin?._args?.[0];
|
|
373
|
+
if (opts && typeof opts.publicPath === 'string') {
|
|
374
|
+
opts.publicPath = replaceWildcard(opts.publicPath);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
// Wire CSS handling — forces extraction via @lynx-js/css-extract-webpack-plugin,
|
|
379
|
+
// strips lightningcss, and configures ignore-css-loader for main-thread layer.
|
|
380
|
+
applyCSS(api, {
|
|
381
|
+
enableCSSSelector: _enableCSSSelector,
|
|
382
|
+
enableCSSInvalidation: _enableCSSInheritance,
|
|
383
|
+
});
|
|
384
|
+
// Wire dual-thread entry splitting (worklets skipped in v1)
|
|
385
|
+
await applyEntry(api, {
|
|
386
|
+
debugInfoOutside: _debugInfoOutside,
|
|
387
|
+
enableCSSInheritance: _enableCSSInheritance,
|
|
388
|
+
customCSSInheritanceList: _customCSSInheritanceList,
|
|
389
|
+
});
|
|
390
|
+
// Wire @sigx/lynx-icons — reads iconSets from signalx.config.ts,
|
|
391
|
+
// scans the project for <Icon> usage, and aliases the runtime's
|
|
392
|
+
// virtual-module subpaths to generated codepoint / SVG maps.
|
|
393
|
+
// Safe to call unconditionally; bails out when no iconSets are
|
|
394
|
+
// configured or @sigx/lynx-cli isn't installed.
|
|
395
|
+
await applyIcons(api);
|
|
396
|
+
},
|
|
397
|
+
};
|
|
203
398
|
}
|
|
204
|
-
function w(e, t, n) {
|
|
205
|
-
let r = e.get(t);
|
|
206
|
-
r || (r = /* @__PURE__ */ new Set(), e.set(t, r)), r.add(n);
|
|
207
|
-
}
|
|
208
|
-
function T(e) {
|
|
209
|
-
if (!e.includes("<Icon")) return [];
|
|
210
|
-
let t = /* @__PURE__ */ new Set(), n = [], r = (e, r) => {
|
|
211
|
-
let i = `${e}\0${r}`;
|
|
212
|
-
t.has(i) || (t.add(i), n.push({
|
|
213
|
-
set: e,
|
|
214
|
-
name: r
|
|
215
|
-
}));
|
|
216
|
-
};
|
|
217
|
-
for (let t of e.matchAll(y)) r(t[1], t[2]);
|
|
218
|
-
for (let t of e.matchAll(b)) r(t[2], t[1]);
|
|
219
|
-
return n;
|
|
220
|
-
}
|
|
221
|
-
async function E(e) {
|
|
222
|
-
let t = /* @__PURE__ */ new Map(), n = await C(e);
|
|
223
|
-
return await Promise.all(n.map(async (e) => {
|
|
224
|
-
let n = await s.readFile(e, "utf8").catch(() => "");
|
|
225
|
-
for (let { set: e, name: r } of T(n)) w(t, e, r);
|
|
226
|
-
})), t;
|
|
227
|
-
}
|
|
228
|
-
async function D(e, t) {
|
|
229
|
-
try {
|
|
230
|
-
let r = await import(i(a(n(e, "noop.js")).resolve(t)).href);
|
|
231
|
-
return r.default ?? r;
|
|
232
|
-
} catch (e) {
|
|
233
|
-
return process.env.SIGX_DEBUG_ICONS && console.warn(`[@sigx/lynx-plugin] icons: failed to load adapter "${t}":`, e), null;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
function O(e, t, n) {
|
|
237
|
-
let r = {}, i = {}, a = t.styles ?? e.styles;
|
|
238
|
-
for (let t of n) {
|
|
239
|
-
let n = null;
|
|
240
|
-
for (let r of a) if (n = e.getGlyph(r, t), n) break;
|
|
241
|
-
n && (i[t] = { svg: n.svg });
|
|
242
|
-
}
|
|
243
|
-
return {
|
|
244
|
-
codepoints: r,
|
|
245
|
-
svgs: i
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
async function k(e, t = {}) {
|
|
249
|
-
let r = t.cwd ?? process.cwd();
|
|
250
|
-
if (![
|
|
251
|
-
"signalx.config.ts",
|
|
252
|
-
"signalx.config.js",
|
|
253
|
-
"signalx.config.mjs"
|
|
254
|
-
].some((e) => o(n(r, e)))) return;
|
|
255
|
-
let i;
|
|
256
|
-
try {
|
|
257
|
-
i = await import("@sigx/lynx-cli");
|
|
258
|
-
} catch {
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
let a = await i.loadConfig(r), c = i.resolveConfig(a);
|
|
262
|
-
if (!c.iconSets || c.iconSets.length === 0) return;
|
|
263
|
-
let l = await E(r), u = {}, d = {};
|
|
264
|
-
for (let e of c.iconSets) {
|
|
265
|
-
let t = await D(r, e.source);
|
|
266
|
-
if (!t) continue;
|
|
267
|
-
let n = new Set(l.get(e.id) ?? []);
|
|
268
|
-
for (let t of e.include) n.add(t);
|
|
269
|
-
if (e.include.includes("*")) {
|
|
270
|
-
n.delete("*");
|
|
271
|
-
let r = e.styles ?? t.styles;
|
|
272
|
-
for (let e of r) for (let r of t.listGlyphs(e)) n.add(r);
|
|
273
|
-
console.log(`[@sigx/lynx-plugin] icons: ${e.id} bundling ${n.size} glyphs (include: ['*'])`);
|
|
274
|
-
}
|
|
275
|
-
if (n.size === 0) continue;
|
|
276
|
-
let { codepoints: i, svgs: a } = O(t, e, n);
|
|
277
|
-
Object.keys(i).length > 0 && (u[e.id] = i), Object.keys(a).length > 0 && (d[e.id] = a);
|
|
278
|
-
}
|
|
279
|
-
let f = n(r, "node_modules", ".cache", "sigx-lynx-icons");
|
|
280
|
-
await s.mkdir(f, { recursive: !0 });
|
|
281
|
-
let p = n(f, "codepoints.mjs"), m = n(f, "svgs.mjs"), h = n(f, "font-face.css");
|
|
282
|
-
await s.writeFile(p, `// Auto-generated by @sigx/lynx-plugin — do not edit.\nexport const codepoints = ${JSON.stringify(u)};\n`), await s.writeFile(m, `// Auto-generated by @sigx/lynx-plugin — do not edit.\nexport const svgs = ${JSON.stringify(d)};\n`), await s.writeFile(h, "/* Auto-generated by @sigx/lynx-plugin — font mode lands in v1.1. */\n"), e.modifyBundlerChain((e) => {
|
|
283
|
-
e.resolve.alias.set("@sigx/lynx-icons/__codepoints", p), e.resolve.alias.set("@sigx/lynx-icons/__svgs", m), e.resolve.alias.set("@sigx/lynx-icons/__font-face.css", h);
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
//#endregion
|
|
287
|
-
//#region src/index.ts
|
|
288
|
-
var A = t.dirname(r(import.meta.url));
|
|
289
|
-
t.resolve(A, "../..");
|
|
290
|
-
var j = new Set([
|
|
291
|
-
"0.0.0.0",
|
|
292
|
-
"::",
|
|
293
|
-
"0:0:0:0:0:0:0:0"
|
|
294
|
-
]), M = /^(vEthernet|veth|docker|br-|virbr|vmnet|VirtualBox|Hyper-V|WSL|ham\d)/i;
|
|
295
|
-
function N() {
|
|
296
|
-
let t = e(), n;
|
|
297
|
-
for (let [e, r] of Object.entries(t)) for (let t of r ?? []) if (!(t.family !== "IPv4" || t.internal || !t.address) && (n ||= t.address, !M.test(e))) return t.address;
|
|
298
|
-
return n ?? "127.0.0.1";
|
|
299
|
-
}
|
|
300
|
-
function P(e) {
|
|
301
|
-
let t = e.match(/\/\/([^:/]+)/);
|
|
302
|
-
return t ? t[1] : "";
|
|
303
|
-
}
|
|
304
|
-
function F(e = {}) {
|
|
305
|
-
let { enableCSSSelector: t = !0, enableCSSInheritance: n = !1, customCSSInheritanceList: r, debugInfoOutside: i = !0 } = e;
|
|
306
|
-
return {
|
|
307
|
-
name: "lynx:sigx",
|
|
308
|
-
pre: [
|
|
309
|
-
"lynx:rsbuild:plugin-api",
|
|
310
|
-
"lynx:config",
|
|
311
|
-
"lynx:rsbuild:dev"
|
|
312
|
-
],
|
|
313
|
-
async setup(e) {
|
|
314
|
-
e.modifyRsbuildConfig((t, { mergeRsbuildConfig: n }) => {
|
|
315
|
-
e.getRsbuildConfig("original").source?.include === void 0 && (t = n(t, { source: { include: [/\.(?:js|mjs|cjs)$/] } }));
|
|
316
|
-
let r = process.env.SIGX_LYNX_DEV_PORT, i = r && Number.isFinite(Number(r)) ? Number(r) : void 0;
|
|
317
|
-
return i !== void 0 && (t = n(t, { server: { port: i } })), n(t, {
|
|
318
|
-
source: { define: { __DEV__: "process.env.NODE_ENV !== 'production'" } },
|
|
319
|
-
tools: {
|
|
320
|
-
rspack: { output: { iife: !1 } },
|
|
321
|
-
swc: { jsc: {
|
|
322
|
-
target: "es2019",
|
|
323
|
-
transform: { react: {
|
|
324
|
-
runtime: "automatic",
|
|
325
|
-
importSource: "@sigx/lynx",
|
|
326
|
-
throwIfNamespace: !1
|
|
327
|
-
} }
|
|
328
|
-
} }
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
}), e.modifyBundlerChain((e) => {
|
|
332
|
-
e.resolve.alias.set("@sigx/runtime-dom", "@sigx/lynx-runtime");
|
|
333
|
-
}), e.modifyRsbuildConfig((e, { mergeRsbuildConfig: t }) => {
|
|
334
|
-
let n = e.dev?.assetPrefix;
|
|
335
|
-
if (typeof n != "string") return e;
|
|
336
|
-
let r = !1;
|
|
337
|
-
for (let e of j) if (n.includes(`//${e}:`)) {
|
|
338
|
-
r = !0;
|
|
339
|
-
break;
|
|
340
|
-
}
|
|
341
|
-
if (!r) return e;
|
|
342
|
-
let i = N(), a = (e) => {
|
|
343
|
-
for (let t of j) e = e.replaceAll(`//${t}:`, `//${i}:`);
|
|
344
|
-
return e;
|
|
345
|
-
}, o = a(n), s = e.server?.printUrls, c = typeof s == "function" ? (e) => {
|
|
346
|
-
let t = s(e);
|
|
347
|
-
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? a(e) : {
|
|
348
|
-
...e,
|
|
349
|
-
url: a(e.url)
|
|
350
|
-
}) : t;
|
|
351
|
-
} : void 0, l = t(e, {
|
|
352
|
-
dev: {
|
|
353
|
-
assetPrefix: o,
|
|
354
|
-
client: { host: i }
|
|
355
|
-
},
|
|
356
|
-
output: { assetPrefix: o }
|
|
357
|
-
});
|
|
358
|
-
return c && (l.server = {
|
|
359
|
-
...l.server,
|
|
360
|
-
printUrls: c
|
|
361
|
-
}), l;
|
|
362
|
-
}), e.modifyRspackConfig((e) => {
|
|
363
|
-
let t = e.watchOptions ?? {}, n = Array.isArray(t.ignored) ? t.ignored : typeof t.ignored == "string" ? [t.ignored] : [];
|
|
364
|
-
e.watchOptions = {
|
|
365
|
-
...t,
|
|
366
|
-
ignored: [
|
|
367
|
-
"**/node_modules/**",
|
|
368
|
-
"**/.git/**",
|
|
369
|
-
"**/dist/**",
|
|
370
|
-
"**/ios/**",
|
|
371
|
-
"**/android/**",
|
|
372
|
-
"**/Pods/**",
|
|
373
|
-
"**/.rspeedy/**",
|
|
374
|
-
...n
|
|
375
|
-
],
|
|
376
|
-
followSymlinks: t.followSymlinks ?? !1,
|
|
377
|
-
poll: t.poll ?? (process.env.SIGX_LYNX_WATCH_POLL ? Number(process.env.SIGX_LYNX_WATCH_POLL) || !0 : void 0)
|
|
378
|
-
};
|
|
379
|
-
}), e.modifyRspackConfig((e) => {
|
|
380
|
-
let t = !1, n = e.output?.publicPath;
|
|
381
|
-
if (typeof n == "string") {
|
|
382
|
-
for (let e of j) if (n.includes(`//${e}:`)) {
|
|
383
|
-
t = !0;
|
|
384
|
-
break;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
if (!t) {
|
|
388
|
-
let n = e.resolve?.alias;
|
|
389
|
-
if (n && typeof n == "object" && !Array.isArray(n)) for (let e of Object.values(n)) {
|
|
390
|
-
if (typeof e == "string") {
|
|
391
|
-
for (let n of j) if (e.includes(`hostname=${n}`)) {
|
|
392
|
-
t = !0;
|
|
393
|
-
break;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
if (t) break;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
if (!t) return;
|
|
400
|
-
let r = N(), i = (e) => {
|
|
401
|
-
for (let t of j) e = e.replaceAll(`//${t}:`, `//${r}:`), e = e.replaceAll(`hostname=${t}`, `hostname=${r}`);
|
|
402
|
-
return e;
|
|
403
|
-
};
|
|
404
|
-
e.output && (e.output.publicPath = i(e.output.publicPath));
|
|
405
|
-
let a = e.resolve?.alias;
|
|
406
|
-
if (a && typeof a == "object" && !Array.isArray(a)) {
|
|
407
|
-
for (let [e, t] of Object.entries(a)) if (typeof t == "string") {
|
|
408
|
-
let n = i(t);
|
|
409
|
-
n !== t && (a[e] = n);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
for (let t of e.plugins ?? []) {
|
|
413
|
-
let e = t?.definitions ?? t?._args?.[0];
|
|
414
|
-
if (!(!e || typeof e != "object")) {
|
|
415
|
-
for (let [t, n] of Object.entries(e)) if (typeof n == "string" && j.has(P(n))) e[t] = i(n);
|
|
416
|
-
else if (typeof n == "object" && n) for (let [e, t] of Object.entries(n)) typeof t == "string" && j.has(P(t)) && (n[e] = i(t));
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
for (let t of e.plugins ?? []) {
|
|
420
|
-
let e = t?._options ?? t?._args?.[0];
|
|
421
|
-
e && typeof e.publicPath == "string" && (e.publicPath = i(e.publicPath));
|
|
422
|
-
}
|
|
423
|
-
}), u(e, {
|
|
424
|
-
enableCSSSelector: t,
|
|
425
|
-
enableCSSInvalidation: n
|
|
426
|
-
}), await v(e, {
|
|
427
|
-
debugInfoOutside: i,
|
|
428
|
-
enableCSSInheritance: n,
|
|
429
|
-
customCSSInheritanceList: r
|
|
430
|
-
}), await k(e);
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
//#endregion
|
|
435
|
-
export { c as LAYERS, v as applyEntry, F as pluginSigxLynx };
|
|
436
|
-
|
|
437
|
-
//# sourceMappingURL=index.js.map
|