@lynx-js/react-rsbuild-plugin 0.9.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.
package/dist/index.js ADDED
@@ -0,0 +1,1107 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_react_alias_rsbuild_plugin_2a0391db__ from "@lynx-js/react-alias-rsbuild-plugin";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__ from "@lynx-js/react-webpack-plugin";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__ from "@lynx-js/template-webpack-plugin";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_runtime_wrapper_webpack_plugin_27793081__ from "@lynx-js/runtime-wrapper-webpack-plugin";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_web_webpack_plugin_6ba19e5a__ from "@lynx-js/web-webpack-plugin";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__lynx_js_react_refresh_webpack_plugin_a01c5e97__ from "@lynx-js/react-refresh-webpack-plugin";
10
+ var __webpack_modules__ = {
11
+ "../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
12
+ exports._accessExpressionAsString = void 0;
13
+ const _accessExpressionAsString = (str)=>variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
14
+ exports._accessExpressionAsString = _accessExpressionAsString;
15
+ const variable = (str)=>false === reserved(str) && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
16
+ const reserved = (str)=>RESERVED.has(str);
17
+ const RESERVED = new Set([
18
+ "break",
19
+ "case",
20
+ "catch",
21
+ "class",
22
+ "const",
23
+ "continue",
24
+ "debugger",
25
+ "default",
26
+ "delete",
27
+ "do",
28
+ "else",
29
+ "enum",
30
+ "export",
31
+ "extends",
32
+ "false",
33
+ "finally",
34
+ "for",
35
+ "function",
36
+ "if",
37
+ "import",
38
+ "in",
39
+ "instanceof",
40
+ "new",
41
+ "null",
42
+ "return",
43
+ "super",
44
+ "switch",
45
+ "this",
46
+ "throw",
47
+ "true",
48
+ "try",
49
+ "typeof",
50
+ "var",
51
+ "void",
52
+ "while",
53
+ "with"
54
+ ]);
55
+ },
56
+ "../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
57
+ exports._assertGuard = void 0;
58
+ const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/TypeGuardError.mjs");
59
+ const _assertGuard = (exceptionable, props, factory)=>{
60
+ if (true === exceptionable) {
61
+ if (factory) throw factory(props);
62
+ throw new TypeGuardError_1.TypeGuardError(props);
63
+ }
64
+ return false;
65
+ };
66
+ exports._assertGuard = _assertGuard;
67
+ },
68
+ "../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
69
+ __webpack_require__.r(__webpack_exports__);
70
+ __webpack_require__.d(__webpack_exports__, {
71
+ TypeGuardError: ()=>TypeGuardError
72
+ });
73
+ class TypeGuardError extends Error {
74
+ method;
75
+ path;
76
+ expected;
77
+ value;
78
+ fake_expected_typed_value_;
79
+ constructor(props){
80
+ super(props.message || `Error on ${props.method}(): invalid type${props.path ? ` on ${props.path}` : ""}, expect to be ${props.expected}`);
81
+ const proto = new.target.prototype;
82
+ if (Object.setPrototypeOf) Object.setPrototypeOf(this, proto);
83
+ else this.__proto__ = proto;
84
+ this.method = props.method;
85
+ this.path = props.path;
86
+ this.expected = props.expected;
87
+ this.value = props.value;
88
+ }
89
+ }
90
+ }
91
+ };
92
+ var __webpack_module_cache__ = {};
93
+ function __webpack_require__(moduleId) {
94
+ var cachedModule = __webpack_module_cache__[moduleId];
95
+ if (void 0 !== cachedModule) return cachedModule.exports;
96
+ var module = __webpack_module_cache__[moduleId] = {
97
+ exports: {}
98
+ };
99
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
100
+ return module.exports;
101
+ }
102
+ (()=>{
103
+ __webpack_require__.d = function(exports, definition) {
104
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
105
+ enumerable: true,
106
+ get: definition[key]
107
+ });
108
+ };
109
+ })();
110
+ (()=>{
111
+ __webpack_require__.o = function(obj, prop) {
112
+ return Object.prototype.hasOwnProperty.call(obj, prop);
113
+ };
114
+ })();
115
+ (()=>{
116
+ __webpack_require__.r = function(exports) {
117
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
118
+ value: 'Module'
119
+ });
120
+ Object.defineProperty(exports, '__esModule', {
121
+ value: true
122
+ });
123
+ };
124
+ })();
125
+ function applyAlias(api, lazy) {
126
+ return (0, __WEBPACK_EXTERNAL_MODULE__lynx_js_react_alias_rsbuild_plugin_2a0391db__.pluginReactAlias)({
127
+ LAYERS: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS,
128
+ lazy,
129
+ rootPath: api.context.rootPath
130
+ }).setup(api);
131
+ }
132
+ const DETECT_IMPORT_ERROR = 'react:detect-import-error';
133
+ const ALIAS_BACKGROUND_ONLY_MAIN = 'react:alias-background-only-main';
134
+ const ALIAS_BACKGROUND_ONLY_BACKGROUND = 'react:alias-background-only-background';
135
+ function applyBackgroundOnly(api) {
136
+ const __dirname = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url));
137
+ api.modifyBundlerChain((chain)=>{
138
+ chain.module.rule(ALIAS_BACKGROUND_ONLY_MAIN).issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD).resolve.alias.set('background-only$', __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(__dirname, 'background-only', 'error.js'));
139
+ chain.module.rule(ALIAS_BACKGROUND_ONLY_BACKGROUND).issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND).resolve.alias.set('background-only$', __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(__dirname, 'background-only', 'empty.js'));
140
+ chain.module.rule(DETECT_IMPORT_ERROR).test(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(__dirname, 'background-only', 'error.js')).issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD).use(DETECT_IMPORT_ERROR).loader(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(__dirname, 'loaders/invalid-import-error-loader')).options({
141
+ message: '\'background-only\' cannot be imported from a main-thread module.'
142
+ });
143
+ });
144
+ }
145
+ function applyCSS(api, options) {
146
+ const { enableRemoveCSSScope, enableCSSSelector, targetSdkVersion } = options;
147
+ api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>mergeRsbuildConfig(config, {
148
+ output: {
149
+ injectStyles: false
150
+ }
151
+ }));
152
+ const __dirname = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url));
153
+ api.modifyBundlerChain(async function(chain, { CHAIN_ID, environment }) {
154
+ const { CssExtractRspackPlugin, CssExtractWebpackPlugin } = await import("@lynx-js/css-extract-webpack-plugin");
155
+ const CssExtractPlugin = 'rspack' === api.context.bundlerType ? CssExtractRspackPlugin : CssExtractWebpackPlugin;
156
+ const cssRules = [
157
+ CHAIN_ID.RULE.CSS,
158
+ CHAIN_ID.RULE.SASS,
159
+ CHAIN_ID.RULE.LESS,
160
+ CHAIN_ID.RULE.STYLUS
161
+ ];
162
+ cssRules.filter((rule)=>chain.module.rules.has(rule)).forEach((ruleName)=>{
163
+ const rule = chain.module.rule(ruleName);
164
+ if (rule.uses.has(CHAIN_ID.USE.LIGHTNINGCSS) && 'lynx' === environment.name) rule.uses.delete(CHAIN_ID.USE.LIGHTNINGCSS);
165
+ rule.issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND).use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(CssExtractPlugin.loader).end();
166
+ const uses = rule.uses.entries();
167
+ const ruleEntries = rule.entries();
168
+ const cssLoaderRule = uses[CHAIN_ID.USE.CSS].entries();
169
+ chain.module.rule(`${ruleName}:${__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD}`).merge(ruleEntries).issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD).use(CHAIN_ID.USE.IGNORE_CSS).loader(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(__dirname, './loaders/ignore-css-loader')).end().uses.merge(uses).delete(CHAIN_ID.USE.MINI_CSS_EXTRACT).delete(CHAIN_ID.USE.LIGHTNINGCSS).delete(CHAIN_ID.USE.CSS).end().use(CHAIN_ID.USE.CSS).after(CHAIN_ID.USE.IGNORE_CSS).merge(cssLoaderRule).options(normalizeCssLoaderOptions(cssLoaderRule.options, true)).end();
170
+ });
171
+ chain.plugin(CHAIN_ID.PLUGIN.MINI_CSS_EXTRACT).tap(([options])=>[
172
+ {
173
+ ...options,
174
+ enableRemoveCSSScope: enableRemoveCSSScope ?? true,
175
+ enableCSSSelector,
176
+ targetSdkVersion,
177
+ cssPlugins: [
178
+ __WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.CSSPlugins.parserPlugins.removeFunctionWhiteSpace()
179
+ ]
180
+ }
181
+ ]).init((_, args)=>new CssExtractPlugin(...args)).end().end();
182
+ if (true !== enableRemoveCSSScope) chain.optimization.minimizers.delete(CHAIN_ID.MINIMIZER.CSS);
183
+ chain.module.when(void 0 === enableRemoveCSSScope, (module)=>module.rule('lynx.css.scoped').test(/\.css$/).resourceQuery({
184
+ and: [
185
+ /cssId/
186
+ ]
187
+ }).sideEffects(false));
188
+ });
189
+ }
190
+ const normalizeCssLoaderOptions = (options, exportOnlyLocals)=>{
191
+ if (options.modules && exportOnlyLocals) {
192
+ let { modules } = options;
193
+ modules = true === modules ? {
194
+ exportOnlyLocals: true
195
+ } : 'string' == typeof modules ? {
196
+ mode: modules,
197
+ exportOnlyLocals: true
198
+ } : {
199
+ ...modules,
200
+ exportOnlyLocals: true
201
+ };
202
+ return {
203
+ ...options,
204
+ modules
205
+ };
206
+ }
207
+ return options;
208
+ };
209
+ const PLUGIN_NAME_REACT = 'lynx:react';
210
+ const PLUGIN_NAME_TEMPLATE = 'lynx:template';
211
+ const PLUGIN_NAME_RUNTIME_WRAPPER = 'lynx:runtime-wrapper';
212
+ const PLUGIN_NAME_WEB = 'lynx:web';
213
+ const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
214
+ const DEFAULT_FILENAME_HASH = '.[contenthash:8]';
215
+ const EMPTY_HASH = '';
216
+ function applyEntry(api, options) {
217
+ const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, experimental_isLazyBundle } = options;
218
+ const { config } = api.useExposed(Symbol.for('rspeedy.api'));
219
+ api.modifyBundlerChain((chain, { environment, isDev, isProd })=>{
220
+ const entries = chain.entryPoints.entries() ?? {};
221
+ const isLynx = 'lynx' === environment.name;
222
+ const isWeb = 'web' === environment.name;
223
+ chain.entryPoints.clear();
224
+ const mainThreadChunks = [];
225
+ Object.entries(entries).forEach(([entryName, entryPoint])=>{
226
+ const { imports } = getChunks(entryName, entryPoint.values());
227
+ const templateFilename = ('object' == typeof config.output?.filename ? config.output.filename.bundle ?? config.output.filename.template : config.output?.filename) ?? '[name].[platform].bundle';
228
+ const mainThreadName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', `${entryName}/main-thread.js`);
229
+ const mainThreadEntry = entryName;
230
+ const backgroundName = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(isLynx ? DEFAULT_DIST_PATH_INTERMEDIATE : '', getBackgroundFilename(entryName, environment.config, isProd));
231
+ const backgroundEntry = `${entryName}:background`;
232
+ mainThreadChunks.push(mainThreadName);
233
+ chain.entry(mainThreadEntry).add({
234
+ layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD,
235
+ import: imports,
236
+ filename: mainThreadName
237
+ }).when(isDev && !isWeb, (entry)=>{
238
+ const require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url);
239
+ entry.add({
240
+ layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD,
241
+ import: require.resolve('@lynx-js/css-extract-webpack-plugin/runtime/hotModuleReplacement.lepus.cjs')
242
+ });
243
+ }).end().entry(backgroundEntry).add({
244
+ layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND,
245
+ import: imports,
246
+ filename: backgroundName
247
+ }).when(isDev && !isWeb, (entry)=>{
248
+ entry.add({
249
+ layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND,
250
+ import: '@rspack/core/hot/dev-server'
251
+ }).add({
252
+ layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND,
253
+ import: '@lynx-js/webpack-dev-transport/client'
254
+ }).add({
255
+ layer: __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND,
256
+ import: '@lynx-js/react/refresh'
257
+ });
258
+ }).end().plugin(`${PLUGIN_NAME_TEMPLATE}-${entryName}`).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.LynxTemplatePlugin, [
259
+ {
260
+ dsl: 'react_nodiff',
261
+ chunks: [
262
+ mainThreadEntry,
263
+ backgroundEntry
264
+ ],
265
+ filename: templateFilename.replaceAll('[name]', entryName).replaceAll('[platform]', environment.name),
266
+ intermediate: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(DEFAULT_DIST_PATH_INTERMEDIATE, entryName),
267
+ customCSSInheritanceList,
268
+ debugInfoOutside,
269
+ defaultDisplayLinear,
270
+ enableA11y: true,
271
+ enableAccessibilityElement,
272
+ enableICU,
273
+ enableCSSInheritance,
274
+ enableCSSInvalidation,
275
+ enableCSSSelector,
276
+ enableNewGesture,
277
+ enableParallelElement,
278
+ enableRemoveCSSScope: enableRemoveCSSScope ?? true,
279
+ pipelineSchedulerConfig,
280
+ removeDescendantSelectorScope,
281
+ targetSdkVersion,
282
+ experimental_isLazyBundle,
283
+ cssPlugins: [
284
+ __WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.CSSPlugins.parserPlugins.removeFunctionWhiteSpace()
285
+ ]
286
+ }
287
+ ]).end();
288
+ });
289
+ if (isLynx) chain.plugin(PLUGIN_NAME_RUNTIME_WRAPPER).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_runtime_wrapper_webpack_plugin_27793081__.RuntimeWrapperWebpackPlugin, [
290
+ {
291
+ injectVars (vars) {
292
+ return vars.map((name)=>{
293
+ if ('Component' === name) return '__Component';
294
+ return name;
295
+ });
296
+ },
297
+ targetSdkVersion,
298
+ test: /^(?!.*main-thread(?:\.[A-Fa-f0-9]*)?\.js$).*\.js$/
299
+ }
300
+ ]).end().plugin(`${__WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.LynxEncodePlugin.name}`).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_template_webpack_plugin_e98d2f08__.LynxEncodePlugin, [
301
+ {}
302
+ ]).end();
303
+ if (isWeb) chain.plugin(PLUGIN_NAME_WEB).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_web_webpack_plugin_6ba19e5a__.WebWebpackPlugin, []).end();
304
+ chain.plugin(PLUGIN_NAME_REACT).after(PLUGIN_NAME_TEMPLATE).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.ReactWebpackPlugin, [
305
+ {
306
+ disableCreateSelectorQueryIncompatibleWarning: compat?.disableCreateSelectorQueryIncompatibleWarning ?? false,
307
+ firstScreenSyncTiming,
308
+ mainThreadChunks
309
+ }
310
+ ]);
311
+ });
312
+ }
313
+ function getChunks(entryName, entryValue) {
314
+ const chunks = [
315
+ entryName
316
+ ];
317
+ const imports = [];
318
+ for (const item of entryValue){
319
+ if ('string' == typeof item) {
320
+ imports.push(item);
321
+ continue;
322
+ }
323
+ if (Array.isArray(item)) {
324
+ imports.push(...imports);
325
+ continue;
326
+ }
327
+ const { dependOn } = item;
328
+ if (Array.isArray(item.import)) imports.push(...item.import);
329
+ else imports.push(item.import);
330
+ if (!!dependOn) {
331
+ if ('string' == typeof dependOn) chunks.unshift(dependOn);
332
+ else chunks.unshift(...dependOn);
333
+ }
334
+ }
335
+ return {
336
+ chunks,
337
+ imports
338
+ };
339
+ }
340
+ function getBackgroundFilename(entryName, config, isProd) {
341
+ const { filename } = config.output;
342
+ if ('string' == typeof filename.js) return filename.js.replaceAll('[name]', entryName).replaceAll('.js', '/background.js');
343
+ return `${entryName}/background${getHash(config, isProd)}.js`;
344
+ }
345
+ function getHash(config, isProd) {
346
+ if ('string' == typeof config.output?.filenameHash) return config.output.filenameHash ? `.[${config.output.filenameHash}]` : EMPTY_HASH;
347
+ if (config.output?.filenameHash === false) return EMPTY_HASH;
348
+ if (isProd) return DEFAULT_FILENAME_HASH;
349
+ return EMPTY_HASH;
350
+ }
351
+ function applyLazy(api) {
352
+ api.modifyBundlerChain((chain)=>{
353
+ chain.output.library({
354
+ type: 'commonjs'
355
+ });
356
+ });
357
+ }
358
+ function applyLoaders(api, options) {
359
+ const { compat, enableRemoveCSSScope, jsx, shake, defineDCE, experimental_isLazyBundle } = options;
360
+ api.modifyBundlerChain((chain, { CHAIN_ID })=>{
361
+ const experiments = chain.get('experiments');
362
+ chain.experiments({
363
+ ...experiments,
364
+ layers: true
365
+ });
366
+ const rule = chain.module.rules.get(CHAIN_ID.RULE.JS);
367
+ const uses = rule.uses.entries() ?? {};
368
+ const { output } = api.getRsbuildConfig();
369
+ const inlineSourcesContent = output?.sourceMap === true || !(output?.sourceMap === false || output?.sourceMap?.js === false || output?.sourceMap?.js?.includes('nosources'));
370
+ const backgroundRule = rule.oneOf(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND);
371
+ backgroundRule.issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND).uses.merge(uses).end().use(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND).loader(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.ReactWebpackPlugin.loaders.BACKGROUND).options({
372
+ compat,
373
+ enableRemoveCSSScope,
374
+ jsx,
375
+ isDynamicComponent: experimental_isLazyBundle,
376
+ inlineSourcesContent,
377
+ defineDCE
378
+ }).end();
379
+ const mainThreadRule = rule.oneOf(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD);
380
+ mainThreadRule.issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD).uses.merge(uses).end().when(void 0 !== uses[CHAIN_ID.USE.SWC], (rule)=>{
381
+ rule.uses.delete(CHAIN_ID.USE.SWC);
382
+ const swcLoaderRule = uses[CHAIN_ID.USE.SWC].entries();
383
+ const swcLoaderOptions = swcLoaderRule.options;
384
+ rule.use(CHAIN_ID.USE.SWC).merge(swcLoaderRule).options({
385
+ ...swcLoaderOptions,
386
+ jsc: {
387
+ ...swcLoaderOptions.jsc,
388
+ target: 'es2019'
389
+ }
390
+ });
391
+ }).use(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.MAIN_THREAD).loader(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.ReactWebpackPlugin.loaders.MAIN_THREAD).options({
392
+ compat,
393
+ enableRemoveCSSScope,
394
+ jsx,
395
+ inlineSourcesContent,
396
+ isDynamicComponent: experimental_isLazyBundle,
397
+ shake,
398
+ defineDCE
399
+ }).end();
400
+ rule.uses.clear();
401
+ });
402
+ }
403
+ const PLUGIN_NAME_REACT_REFRESH = 'lynx:react:refresh';
404
+ const refresh_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url);
405
+ function applyRefresh(api) {
406
+ api.modifyWebpackChain((chain, { CHAIN_ID, isProd })=>{
407
+ if (!isProd) applyRefreshRules(chain, CHAIN_ID, __WEBPACK_EXTERNAL_MODULE__lynx_js_react_refresh_webpack_plugin_a01c5e97__.ReactRefreshWebpackPlugin);
408
+ });
409
+ api.modifyBundlerChain((chain, { isProd, CHAIN_ID })=>{
410
+ if (!isProd) {
411
+ applyRefreshRules(chain, CHAIN_ID, __WEBPACK_EXTERNAL_MODULE__lynx_js_react_refresh_webpack_plugin_a01c5e97__.ReactRefreshRspackPlugin);
412
+ chain.resolve.alias.set('@lynx-js/react/refresh$', refresh_require.resolve('@lynx-js/react/refresh')).end();
413
+ }
414
+ });
415
+ }
416
+ function applyRefreshRules(chain, CHAIN_ID, ReactRefreshPlugin) {
417
+ chain.plugin(PLUGIN_NAME_REACT_REFRESH).before(CHAIN_ID.PLUGIN.HMR).use(ReactRefreshPlugin).end().module.rule('react:refresh').issuerLayer(__WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS.BACKGROUND).before(CHAIN_ID.RULE.JS).test(/\.[jt]sx$/).exclude.add(/node_modules/).add(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(refresh_require.resolve('@lynx-js/react/package.json'))).add(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(refresh_require.resolve('@lynx-js/react/refresh'))).add(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(refresh_require.resolve('@lynx-js/react/worklet-runtime'))).add(ReactRefreshPlugin.loader).end().use('ReactRefresh').loader(ReactRefreshPlugin.loader).options({}).end().end().end().end();
418
+ }
419
+ const isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj);
420
+ const applySplitChunksRule = (api)=>{
421
+ api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
422
+ const userConfig = api.getRsbuildConfig('original');
423
+ if (!userConfig.performance?.chunkSplit?.strategy) return mergeRsbuildConfig(config, {
424
+ performance: {
425
+ chunkSplit: {
426
+ strategy: 'all-in-one'
427
+ }
428
+ }
429
+ });
430
+ return config;
431
+ });
432
+ api.modifyBundlerChain((chain, { environment })=>{
433
+ const { config } = environment;
434
+ if ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
435
+ const currentConfig = chain.optimization.splitChunks.values();
436
+ if (!isPlainObject(currentConfig)) return;
437
+ const extraGroups = {};
438
+ extraGroups['preact'] = {
439
+ name: 'lib-preact',
440
+ test: /node_modules[\\/](.*?[\\/])?(?:preact|preact[\\/]compat|preact[\\/]hooks|preact[\\/]jsx-runtime)[\\/]/,
441
+ priority: 0
442
+ };
443
+ chain.optimization.splitChunks({
444
+ ...currentConfig,
445
+ cacheGroups: {
446
+ ...currentConfig.cacheGroups,
447
+ ...extraGroups
448
+ }
449
+ });
450
+ });
451
+ api.modifyRspackConfig((rspackConfig, { environment })=>{
452
+ if ('lynx' !== environment.name) return rspackConfig;
453
+ if (!rspackConfig.optimization) return rspackConfig;
454
+ if (!rspackConfig.optimization.splitChunks) return rspackConfig;
455
+ rspackConfig.optimization.splitChunks.chunks = function(chunk) {
456
+ return Boolean(chunk.name?.includes(':background'));
457
+ };
458
+ return rspackConfig;
459
+ });
460
+ };
461
+ function applySWC(api) {
462
+ api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>mergeRsbuildConfig(config, {
463
+ tools: {
464
+ swc (config) {
465
+ config.jsc ??= {};
466
+ config.jsc.transform ??= {};
467
+ config.jsc.transform.useDefineForClassFields = false;
468
+ config.jsc.transform.optimizer ??= {};
469
+ config.jsc.transform.optimizer.simplify = true;
470
+ config.jsc.parser ??= {
471
+ syntax: "typescript"
472
+ };
473
+ if ("typescript" === config.jsc.parser.syntax) {
474
+ config.jsc.parser.tsx = false;
475
+ config.jsc.parser.decorators = true;
476
+ }
477
+ return config;
478
+ }
479
+ }
480
+ }));
481
+ }
482
+ var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_accessExpressionAsString.js");
483
+ var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@7.6.4_@samchon+openapi@2.4.2_typescript@5.7.3/node_modules/typia/lib/internal/_assertGuard.js");
484
+ const validateConfig = (()=>{
485
+ const _io0 = (input, _exceptionable = true)=>(void 0 === input.compat || "object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) && _io1(input.compat, _exceptionable)) && (void 0 === input.customCSSInheritanceList || Array.isArray(input.customCSSInheritanceList) && input.customCSSInheritanceList.every((elem, _index1)=>"string" == typeof elem)) && (void 0 === input.debugInfoOutside || "boolean" == typeof input.debugInfoOutside) && (void 0 === input.defaultDisplayLinear || "boolean" == typeof input.defaultDisplayLinear) && (void 0 === input.enableAccessibilityElement || "boolean" == typeof input.enableAccessibilityElement) && (void 0 === input.enableICU || "boolean" == typeof input.enableICU) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance) && (void 0 === input.enableCSSInvalidation || "boolean" == typeof input.enableCSSInvalidation) && (void 0 === input.enableCSSSelector || "boolean" == typeof input.enableCSSSelector) && (void 0 === input.enableNewGesture || "boolean" == typeof input.enableNewGesture) && (void 0 === input.enableParallelElement || "boolean" == typeof input.enableParallelElement) && (void 0 === input.enableRemoveCSSScope || "boolean" == typeof input.enableRemoveCSSScope) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming) && (void 0 === input.jsx || "object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) && _io3(input.jsx, _exceptionable)) && (void 0 === input.pipelineSchedulerConfig || "number" == typeof input.pipelineSchedulerConfig) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope) && (void 0 === input.shake || "object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) && _io4(input.shake, _exceptionable)) && (void 0 === input.defineDCE || "object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) && _io5(input.defineDCE, _exceptionable)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
486
+ if ([
487
+ "compat",
488
+ "customCSSInheritanceList",
489
+ "debugInfoOutside",
490
+ "defaultDisplayLinear",
491
+ "enableAccessibilityElement",
492
+ "enableICU",
493
+ "enableCSSInheritance",
494
+ "enableCSSInvalidation",
495
+ "enableCSSSelector",
496
+ "enableNewGesture",
497
+ "enableParallelElement",
498
+ "enableRemoveCSSScope",
499
+ "firstScreenSyncTiming",
500
+ "jsx",
501
+ "pipelineSchedulerConfig",
502
+ "removeDescendantSelectorScope",
503
+ "shake",
504
+ "defineDCE",
505
+ "engineVersion",
506
+ "targetSdkVersion",
507
+ "experimental_isLazyBundle"
508
+ ].some((prop)=>key === prop)) return true;
509
+ const value = input[key];
510
+ if (void 0 === value) return true;
511
+ return false;
512
+ }));
513
+ const _io1 = (input, _exceptionable = true)=>(void 0 === input.componentsPkg || Array.isArray(input.componentsPkg) && input.componentsPkg.every((elem, _index2)=>"string" == typeof elem)) && (void 0 === input.oldRuntimePkg || Array.isArray(input.oldRuntimePkg) && input.oldRuntimePkg.every((elem, _index3)=>"string" == typeof elem)) && (void 0 === input.newRuntimePkg || "string" == typeof input.newRuntimePkg) && (void 0 === input.additionalComponentAttributes || Array.isArray(input.additionalComponentAttributes) && input.additionalComponentAttributes.every((elem, _index4)=>"string" == typeof elem)) && (void 0 === input.addComponentElement || "boolean" == typeof input.addComponentElement) && (void 0 === input.simplifyCtorLikeReactLynx2 || "boolean" == typeof input.simplifyCtorLikeReactLynx2) && (void 0 === input.removeComponentAttrRegex || "string" == typeof input.removeComponentAttrRegex) && (void 0 === input.disableDeprecatedWarning || "boolean" == typeof input.disableDeprecatedWarning) && null !== input.darkMode && (void 0 === input.darkMode || "boolean" == typeof input.darkMode || "object" == typeof input.darkMode && null !== input.darkMode && _io2(input.darkMode, _exceptionable)) && (void 0 === input.disableCreateSelectorQueryIncompatibleWarning || "boolean" == typeof input.disableCreateSelectorQueryIncompatibleWarning) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
514
+ if ([
515
+ "componentsPkg",
516
+ "oldRuntimePkg",
517
+ "newRuntimePkg",
518
+ "additionalComponentAttributes",
519
+ "addComponentElement",
520
+ "simplifyCtorLikeReactLynx2",
521
+ "removeComponentAttrRegex",
522
+ "disableDeprecatedWarning",
523
+ "darkMode",
524
+ "disableCreateSelectorQueryIncompatibleWarning"
525
+ ].some((prop)=>key === prop)) return true;
526
+ const value = input[key];
527
+ if (void 0 === value) return true;
528
+ return false;
529
+ }));
530
+ const _io2 = (input, _exceptionable = true)=>"string" == typeof input.themeExpr && (1 === Object.keys(input).length || Object.keys(input).every((key)=>{
531
+ if ([
532
+ "themeExpr"
533
+ ].some((prop)=>key === prop)) return true;
534
+ const value = input[key];
535
+ if (void 0 === value) return true;
536
+ return false;
537
+ }));
538
+ const _io3 = (input, _exceptionable = true)=>(void 0 === input.preserveJsx || "boolean" == typeof input.preserveJsx) && (void 0 === input.runtimePkg || "string" == typeof input.runtimePkg) && (void 0 === input.jsxImportSource || "string" == typeof input.jsxImportSource) && (void 0 === input.filename || "string" == typeof input.filename) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
539
+ if ([
540
+ "preserveJsx",
541
+ "runtimePkg",
542
+ "jsxImportSource",
543
+ "filename"
544
+ ].some((prop)=>key === prop)) return true;
545
+ const value = input[key];
546
+ if (void 0 === value) return true;
547
+ return false;
548
+ }));
549
+ const _io4 = (input, _exceptionable = true)=>(void 0 === input.pkgName || Array.isArray(input.pkgName) && input.pkgName.every((elem, _index5)=>"string" == typeof elem)) && (void 0 === input.retainProp || Array.isArray(input.retainProp) && input.retainProp.every((elem, _index6)=>"string" == typeof elem)) && (void 0 === input.removeCallParams || Array.isArray(input.removeCallParams) && input.removeCallParams.every((elem, _index7)=>"string" == typeof elem)) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
550
+ if ([
551
+ "pkgName",
552
+ "retainProp",
553
+ "removeCallParams"
554
+ ].some((prop)=>key === prop)) return true;
555
+ const value = input[key];
556
+ if (void 0 === value) return true;
557
+ return false;
558
+ }));
559
+ const _io5 = (input, _exceptionable = true)=>(void 0 === input.define || "object" == typeof input.define && null !== input.define && false === Array.isArray(input.define) && _io6(input.define, _exceptionable)) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
560
+ if ([
561
+ "define"
562
+ ].some((prop)=>key === prop)) return true;
563
+ const value = input[key];
564
+ if (void 0 === value) return true;
565
+ return false;
566
+ }));
567
+ const _io6 = (input, _exceptionable = true)=>Object.keys(input).every((key)=>{
568
+ const value = input[key];
569
+ if (void 0 === value) return true;
570
+ return "string" == typeof value;
571
+ });
572
+ const _ao0 = (input, _path, _exceptionable = true)=>(void 0 === input.compat || ("object" == typeof input.compat && null !== input.compat && false === Array.isArray(input.compat) || _assertGuard._assertGuard(_exceptionable, {
573
+ method: "typia.createAssertEquals",
574
+ path: _path + ".compat",
575
+ expected: "(Partial<CompatVisitorConfig> & { disableCreateSelectorQueryIncompatibleWarning?: boolean; } | undefined)",
576
+ value: input.compat
577
+ }, _errorFactory)) && _ao1(input.compat, _path + ".compat", _exceptionable) || _assertGuard._assertGuard(_exceptionable, {
578
+ method: "typia.createAssertEquals",
579
+ path: _path + ".compat",
580
+ expected: "(Partial<CompatVisitorConfig> & { disableCreateSelectorQueryIncompatibleWarning?: boolean; } | undefined)",
581
+ value: input.compat
582
+ }, _errorFactory)) && (void 0 === input.customCSSInheritanceList || (Array.isArray(input.customCSSInheritanceList) || _assertGuard._assertGuard(_exceptionable, {
583
+ method: "typia.createAssertEquals",
584
+ path: _path + ".customCSSInheritanceList",
585
+ expected: "(Array<string> | undefined)",
586
+ value: input.customCSSInheritanceList
587
+ }, _errorFactory)) && input.customCSSInheritanceList.every((elem, _index8)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
588
+ method: "typia.createAssertEquals",
589
+ path: _path + ".customCSSInheritanceList[" + _index8 + "]",
590
+ expected: "string",
591
+ value: elem
592
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
593
+ method: "typia.createAssertEquals",
594
+ path: _path + ".customCSSInheritanceList",
595
+ expected: "(Array<string> | undefined)",
596
+ value: input.customCSSInheritanceList
597
+ }, _errorFactory)) && (void 0 === input.debugInfoOutside || "boolean" == typeof input.debugInfoOutside || _assertGuard._assertGuard(_exceptionable, {
598
+ method: "typia.createAssertEquals",
599
+ path: _path + ".debugInfoOutside",
600
+ expected: "(boolean | undefined)",
601
+ value: input.debugInfoOutside
602
+ }, _errorFactory)) && (void 0 === input.defaultDisplayLinear || "boolean" == typeof input.defaultDisplayLinear || _assertGuard._assertGuard(_exceptionable, {
603
+ method: "typia.createAssertEquals",
604
+ path: _path + ".defaultDisplayLinear",
605
+ expected: "(boolean | undefined)",
606
+ value: input.defaultDisplayLinear
607
+ }, _errorFactory)) && (void 0 === input.enableAccessibilityElement || "boolean" == typeof input.enableAccessibilityElement || _assertGuard._assertGuard(_exceptionable, {
608
+ method: "typia.createAssertEquals",
609
+ path: _path + ".enableAccessibilityElement",
610
+ expected: "(boolean | undefined)",
611
+ value: input.enableAccessibilityElement
612
+ }, _errorFactory)) && (void 0 === input.enableICU || "boolean" == typeof input.enableICU || _assertGuard._assertGuard(_exceptionable, {
613
+ method: "typia.createAssertEquals",
614
+ path: _path + ".enableICU",
615
+ expected: "(boolean | undefined)",
616
+ value: input.enableICU
617
+ }, _errorFactory)) && (void 0 === input.enableCSSInheritance || "boolean" == typeof input.enableCSSInheritance || _assertGuard._assertGuard(_exceptionable, {
618
+ method: "typia.createAssertEquals",
619
+ path: _path + ".enableCSSInheritance",
620
+ expected: "(boolean | undefined)",
621
+ value: input.enableCSSInheritance
622
+ }, _errorFactory)) && (void 0 === input.enableCSSInvalidation || "boolean" == typeof input.enableCSSInvalidation || _assertGuard._assertGuard(_exceptionable, {
623
+ method: "typia.createAssertEquals",
624
+ path: _path + ".enableCSSInvalidation",
625
+ expected: "(boolean | undefined)",
626
+ value: input.enableCSSInvalidation
627
+ }, _errorFactory)) && (void 0 === input.enableCSSSelector || "boolean" == typeof input.enableCSSSelector || _assertGuard._assertGuard(_exceptionable, {
628
+ method: "typia.createAssertEquals",
629
+ path: _path + ".enableCSSSelector",
630
+ expected: "(boolean | undefined)",
631
+ value: input.enableCSSSelector
632
+ }, _errorFactory)) && (void 0 === input.enableNewGesture || "boolean" == typeof input.enableNewGesture || _assertGuard._assertGuard(_exceptionable, {
633
+ method: "typia.createAssertEquals",
634
+ path: _path + ".enableNewGesture",
635
+ expected: "(boolean | undefined)",
636
+ value: input.enableNewGesture
637
+ }, _errorFactory)) && (void 0 === input.enableParallelElement || "boolean" == typeof input.enableParallelElement || _assertGuard._assertGuard(_exceptionable, {
638
+ method: "typia.createAssertEquals",
639
+ path: _path + ".enableParallelElement",
640
+ expected: "(boolean | undefined)",
641
+ value: input.enableParallelElement
642
+ }, _errorFactory)) && (void 0 === input.enableRemoveCSSScope || "boolean" == typeof input.enableRemoveCSSScope || _assertGuard._assertGuard(_exceptionable, {
643
+ method: "typia.createAssertEquals",
644
+ path: _path + ".enableRemoveCSSScope",
645
+ expected: "(boolean | undefined)",
646
+ value: input.enableRemoveCSSScope
647
+ }, _errorFactory)) && (void 0 === input.firstScreenSyncTiming || "immediately" === input.firstScreenSyncTiming || "jsReady" === input.firstScreenSyncTiming || _assertGuard._assertGuard(_exceptionable, {
648
+ method: "typia.createAssertEquals",
649
+ path: _path + ".firstScreenSyncTiming",
650
+ expected: "(\"immediately\" | \"jsReady\" | undefined)",
651
+ value: input.firstScreenSyncTiming
652
+ }, _errorFactory)) && (void 0 === input.jsx || ("object" == typeof input.jsx && null !== input.jsx && false === Array.isArray(input.jsx) || _assertGuard._assertGuard(_exceptionable, {
653
+ method: "typia.createAssertEquals",
654
+ path: _path + ".jsx",
655
+ expected: "(Partial<JsxTransformerConfig> | undefined)",
656
+ value: input.jsx
657
+ }, _errorFactory)) && _ao3(input.jsx, _path + ".jsx", _exceptionable) || _assertGuard._assertGuard(_exceptionable, {
658
+ method: "typia.createAssertEquals",
659
+ path: _path + ".jsx",
660
+ expected: "(Partial<JsxTransformerConfig> | undefined)",
661
+ value: input.jsx
662
+ }, _errorFactory)) && (void 0 === input.pipelineSchedulerConfig || "number" == typeof input.pipelineSchedulerConfig || _assertGuard._assertGuard(_exceptionable, {
663
+ method: "typia.createAssertEquals",
664
+ path: _path + ".pipelineSchedulerConfig",
665
+ expected: "(number | undefined)",
666
+ value: input.pipelineSchedulerConfig
667
+ }, _errorFactory)) && (void 0 === input.removeDescendantSelectorScope || "boolean" == typeof input.removeDescendantSelectorScope || _assertGuard._assertGuard(_exceptionable, {
668
+ method: "typia.createAssertEquals",
669
+ path: _path + ".removeDescendantSelectorScope",
670
+ expected: "(boolean | undefined)",
671
+ value: input.removeDescendantSelectorScope
672
+ }, _errorFactory)) && (void 0 === input.shake || ("object" == typeof input.shake && null !== input.shake && false === Array.isArray(input.shake) || _assertGuard._assertGuard(_exceptionable, {
673
+ method: "typia.createAssertEquals",
674
+ path: _path + ".shake",
675
+ expected: "(Partial<ShakeVisitorConfig> | undefined)",
676
+ value: input.shake
677
+ }, _errorFactory)) && _ao4(input.shake, _path + ".shake", _exceptionable) || _assertGuard._assertGuard(_exceptionable, {
678
+ method: "typia.createAssertEquals",
679
+ path: _path + ".shake",
680
+ expected: "(Partial<ShakeVisitorConfig> | undefined)",
681
+ value: input.shake
682
+ }, _errorFactory)) && (void 0 === input.defineDCE || ("object" == typeof input.defineDCE && null !== input.defineDCE && false === Array.isArray(input.defineDCE) || _assertGuard._assertGuard(_exceptionable, {
683
+ method: "typia.createAssertEquals",
684
+ path: _path + ".defineDCE",
685
+ expected: "(Partial<DefineDceVisitorConfig> | undefined)",
686
+ value: input.defineDCE
687
+ }, _errorFactory)) && _ao5(input.defineDCE, _path + ".defineDCE", _exceptionable) || _assertGuard._assertGuard(_exceptionable, {
688
+ method: "typia.createAssertEquals",
689
+ path: _path + ".defineDCE",
690
+ expected: "(Partial<DefineDceVisitorConfig> | undefined)",
691
+ value: input.defineDCE
692
+ }, _errorFactory)) && (void 0 === input.engineVersion || "string" == typeof input.engineVersion || _assertGuard._assertGuard(_exceptionable, {
693
+ method: "typia.createAssertEquals",
694
+ path: _path + ".engineVersion",
695
+ expected: "(string | undefined)",
696
+ value: input.engineVersion
697
+ }, _errorFactory)) && (void 0 === input.targetSdkVersion || "string" == typeof input.targetSdkVersion || _assertGuard._assertGuard(_exceptionable, {
698
+ method: "typia.createAssertEquals",
699
+ path: _path + ".targetSdkVersion",
700
+ expected: "(string | undefined)",
701
+ value: input.targetSdkVersion
702
+ }, _errorFactory)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle || _assertGuard._assertGuard(_exceptionable, {
703
+ method: "typia.createAssertEquals",
704
+ path: _path + ".experimental_isLazyBundle",
705
+ expected: "(boolean | undefined)",
706
+ value: input.experimental_isLazyBundle
707
+ }, _errorFactory)) && (0 === Object.keys(input).length || false === _exceptionable || Object.keys(input).every((key)=>{
708
+ if ([
709
+ "compat",
710
+ "customCSSInheritanceList",
711
+ "debugInfoOutside",
712
+ "defaultDisplayLinear",
713
+ "enableAccessibilityElement",
714
+ "enableICU",
715
+ "enableCSSInheritance",
716
+ "enableCSSInvalidation",
717
+ "enableCSSSelector",
718
+ "enableNewGesture",
719
+ "enableParallelElement",
720
+ "enableRemoveCSSScope",
721
+ "firstScreenSyncTiming",
722
+ "jsx",
723
+ "pipelineSchedulerConfig",
724
+ "removeDescendantSelectorScope",
725
+ "shake",
726
+ "defineDCE",
727
+ "engineVersion",
728
+ "targetSdkVersion",
729
+ "experimental_isLazyBundle"
730
+ ].some((prop)=>key === prop)) return true;
731
+ const value = input[key];
732
+ if (void 0 === value) return true;
733
+ return _assertGuard._assertGuard(_exceptionable, {
734
+ method: "typia.createAssertEquals",
735
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
736
+ expected: "undefined",
737
+ value: value
738
+ }, _errorFactory);
739
+ }));
740
+ const _ao1 = (input, _path, _exceptionable = true)=>(void 0 === input.componentsPkg || (Array.isArray(input.componentsPkg) || _assertGuard._assertGuard(_exceptionable, {
741
+ method: "typia.createAssertEquals",
742
+ path: _path + ".componentsPkg",
743
+ expected: "(Array<string> | undefined)",
744
+ value: input.componentsPkg
745
+ }, _errorFactory)) && input.componentsPkg.every((elem, _index9)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
746
+ method: "typia.createAssertEquals",
747
+ path: _path + ".componentsPkg[" + _index9 + "]",
748
+ expected: "string",
749
+ value: elem
750
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
751
+ method: "typia.createAssertEquals",
752
+ path: _path + ".componentsPkg",
753
+ expected: "(Array<string> | undefined)",
754
+ value: input.componentsPkg
755
+ }, _errorFactory)) && (void 0 === input.oldRuntimePkg || (Array.isArray(input.oldRuntimePkg) || _assertGuard._assertGuard(_exceptionable, {
756
+ method: "typia.createAssertEquals",
757
+ path: _path + ".oldRuntimePkg",
758
+ expected: "(Array<string> | undefined)",
759
+ value: input.oldRuntimePkg
760
+ }, _errorFactory)) && input.oldRuntimePkg.every((elem, _index10)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
761
+ method: "typia.createAssertEquals",
762
+ path: _path + ".oldRuntimePkg[" + _index10 + "]",
763
+ expected: "string",
764
+ value: elem
765
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
766
+ method: "typia.createAssertEquals",
767
+ path: _path + ".oldRuntimePkg",
768
+ expected: "(Array<string> | undefined)",
769
+ value: input.oldRuntimePkg
770
+ }, _errorFactory)) && (void 0 === input.newRuntimePkg || "string" == typeof input.newRuntimePkg || _assertGuard._assertGuard(_exceptionable, {
771
+ method: "typia.createAssertEquals",
772
+ path: _path + ".newRuntimePkg",
773
+ expected: "(string | undefined)",
774
+ value: input.newRuntimePkg
775
+ }, _errorFactory)) && (void 0 === input.additionalComponentAttributes || (Array.isArray(input.additionalComponentAttributes) || _assertGuard._assertGuard(_exceptionable, {
776
+ method: "typia.createAssertEquals",
777
+ path: _path + ".additionalComponentAttributes",
778
+ expected: "(Array<string> | undefined)",
779
+ value: input.additionalComponentAttributes
780
+ }, _errorFactory)) && input.additionalComponentAttributes.every((elem, _index11)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
781
+ method: "typia.createAssertEquals",
782
+ path: _path + ".additionalComponentAttributes[" + _index11 + "]",
783
+ expected: "string",
784
+ value: elem
785
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
786
+ method: "typia.createAssertEquals",
787
+ path: _path + ".additionalComponentAttributes",
788
+ expected: "(Array<string> | undefined)",
789
+ value: input.additionalComponentAttributes
790
+ }, _errorFactory)) && (void 0 === input.addComponentElement || "boolean" == typeof input.addComponentElement || _assertGuard._assertGuard(_exceptionable, {
791
+ method: "typia.createAssertEquals",
792
+ path: _path + ".addComponentElement",
793
+ expected: "(boolean | undefined)",
794
+ value: input.addComponentElement
795
+ }, _errorFactory)) && (void 0 === input.simplifyCtorLikeReactLynx2 || "boolean" == typeof input.simplifyCtorLikeReactLynx2 || _assertGuard._assertGuard(_exceptionable, {
796
+ method: "typia.createAssertEquals",
797
+ path: _path + ".simplifyCtorLikeReactLynx2",
798
+ expected: "(boolean | undefined)",
799
+ value: input.simplifyCtorLikeReactLynx2
800
+ }, _errorFactory)) && (void 0 === input.removeComponentAttrRegex || "string" == typeof input.removeComponentAttrRegex || _assertGuard._assertGuard(_exceptionable, {
801
+ method: "typia.createAssertEquals",
802
+ path: _path + ".removeComponentAttrRegex",
803
+ expected: "(string | undefined)",
804
+ value: input.removeComponentAttrRegex
805
+ }, _errorFactory)) && (void 0 === input.disableDeprecatedWarning || "boolean" == typeof input.disableDeprecatedWarning || _assertGuard._assertGuard(_exceptionable, {
806
+ method: "typia.createAssertEquals",
807
+ path: _path + ".disableDeprecatedWarning",
808
+ expected: "(boolean | undefined)",
809
+ value: input.disableDeprecatedWarning
810
+ }, _errorFactory)) && (null !== input.darkMode || _assertGuard._assertGuard(_exceptionable, {
811
+ method: "typia.createAssertEquals",
812
+ path: _path + ".darkMode",
813
+ expected: "(DarkModeConfig | boolean | undefined)",
814
+ value: input.darkMode
815
+ }, _errorFactory)) && (void 0 === input.darkMode || "boolean" == typeof input.darkMode || ("object" == typeof input.darkMode && null !== input.darkMode || _assertGuard._assertGuard(_exceptionable, {
816
+ method: "typia.createAssertEquals",
817
+ path: _path + ".darkMode",
818
+ expected: "(DarkModeConfig | boolean | undefined)",
819
+ value: input.darkMode
820
+ }, _errorFactory)) && _ao2(input.darkMode, _path + ".darkMode", _exceptionable) || _assertGuard._assertGuard(_exceptionable, {
821
+ method: "typia.createAssertEquals",
822
+ path: _path + ".darkMode",
823
+ expected: "(DarkModeConfig | boolean | undefined)",
824
+ value: input.darkMode
825
+ }, _errorFactory)) && (void 0 === input.disableCreateSelectorQueryIncompatibleWarning || "boolean" == typeof input.disableCreateSelectorQueryIncompatibleWarning || _assertGuard._assertGuard(_exceptionable, {
826
+ method: "typia.createAssertEquals",
827
+ path: _path + ".disableCreateSelectorQueryIncompatibleWarning",
828
+ expected: "(boolean | undefined)",
829
+ value: input.disableCreateSelectorQueryIncompatibleWarning
830
+ }, _errorFactory)) && (0 === Object.keys(input).length || false === _exceptionable || Object.keys(input).every((key)=>{
831
+ if ([
832
+ "componentsPkg",
833
+ "oldRuntimePkg",
834
+ "newRuntimePkg",
835
+ "additionalComponentAttributes",
836
+ "addComponentElement",
837
+ "simplifyCtorLikeReactLynx2",
838
+ "removeComponentAttrRegex",
839
+ "disableDeprecatedWarning",
840
+ "darkMode",
841
+ "disableCreateSelectorQueryIncompatibleWarning"
842
+ ].some((prop)=>key === prop)) return true;
843
+ const value = input[key];
844
+ if (void 0 === value) return true;
845
+ return _assertGuard._assertGuard(_exceptionable, {
846
+ method: "typia.createAssertEquals",
847
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
848
+ expected: "undefined",
849
+ value: value
850
+ }, _errorFactory);
851
+ }));
852
+ const _ao2 = (input, _path, _exceptionable = true)=>("string" == typeof input.themeExpr || _assertGuard._assertGuard(_exceptionable, {
853
+ method: "typia.createAssertEquals",
854
+ path: _path + ".themeExpr",
855
+ expected: "string",
856
+ value: input.themeExpr
857
+ }, _errorFactory)) && (1 === Object.keys(input).length || false === _exceptionable || Object.keys(input).every((key)=>{
858
+ if ([
859
+ "themeExpr"
860
+ ].some((prop)=>key === prop)) return true;
861
+ const value = input[key];
862
+ if (void 0 === value) return true;
863
+ return _assertGuard._assertGuard(_exceptionable, {
864
+ method: "typia.createAssertEquals",
865
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
866
+ expected: "undefined",
867
+ value: value
868
+ }, _errorFactory);
869
+ }));
870
+ const _ao3 = (input, _path, _exceptionable = true)=>(void 0 === input.preserveJsx || "boolean" == typeof input.preserveJsx || _assertGuard._assertGuard(_exceptionable, {
871
+ method: "typia.createAssertEquals",
872
+ path: _path + ".preserveJsx",
873
+ expected: "(boolean | undefined)",
874
+ value: input.preserveJsx
875
+ }, _errorFactory)) && (void 0 === input.runtimePkg || "string" == typeof input.runtimePkg || _assertGuard._assertGuard(_exceptionable, {
876
+ method: "typia.createAssertEquals",
877
+ path: _path + ".runtimePkg",
878
+ expected: "(string | undefined)",
879
+ value: input.runtimePkg
880
+ }, _errorFactory)) && (void 0 === input.jsxImportSource || "string" == typeof input.jsxImportSource || _assertGuard._assertGuard(_exceptionable, {
881
+ method: "typia.createAssertEquals",
882
+ path: _path + ".jsxImportSource",
883
+ expected: "(string | undefined)",
884
+ value: input.jsxImportSource
885
+ }, _errorFactory)) && (void 0 === input.filename || "string" == typeof input.filename || _assertGuard._assertGuard(_exceptionable, {
886
+ method: "typia.createAssertEquals",
887
+ path: _path + ".filename",
888
+ expected: "(string | undefined)",
889
+ value: input.filename
890
+ }, _errorFactory)) && (0 === Object.keys(input).length || false === _exceptionable || Object.keys(input).every((key)=>{
891
+ if ([
892
+ "preserveJsx",
893
+ "runtimePkg",
894
+ "jsxImportSource",
895
+ "filename"
896
+ ].some((prop)=>key === prop)) return true;
897
+ const value = input[key];
898
+ if (void 0 === value) return true;
899
+ return _assertGuard._assertGuard(_exceptionable, {
900
+ method: "typia.createAssertEquals",
901
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
902
+ expected: "undefined",
903
+ value: value
904
+ }, _errorFactory);
905
+ }));
906
+ const _ao4 = (input, _path, _exceptionable = true)=>(void 0 === input.pkgName || (Array.isArray(input.pkgName) || _assertGuard._assertGuard(_exceptionable, {
907
+ method: "typia.createAssertEquals",
908
+ path: _path + ".pkgName",
909
+ expected: "(Array<string> | undefined)",
910
+ value: input.pkgName
911
+ }, _errorFactory)) && input.pkgName.every((elem, _index12)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
912
+ method: "typia.createAssertEquals",
913
+ path: _path + ".pkgName[" + _index12 + "]",
914
+ expected: "string",
915
+ value: elem
916
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
917
+ method: "typia.createAssertEquals",
918
+ path: _path + ".pkgName",
919
+ expected: "(Array<string> | undefined)",
920
+ value: input.pkgName
921
+ }, _errorFactory)) && (void 0 === input.retainProp || (Array.isArray(input.retainProp) || _assertGuard._assertGuard(_exceptionable, {
922
+ method: "typia.createAssertEquals",
923
+ path: _path + ".retainProp",
924
+ expected: "(Array<string> | undefined)",
925
+ value: input.retainProp
926
+ }, _errorFactory)) && input.retainProp.every((elem, _index13)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
927
+ method: "typia.createAssertEquals",
928
+ path: _path + ".retainProp[" + _index13 + "]",
929
+ expected: "string",
930
+ value: elem
931
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
932
+ method: "typia.createAssertEquals",
933
+ path: _path + ".retainProp",
934
+ expected: "(Array<string> | undefined)",
935
+ value: input.retainProp
936
+ }, _errorFactory)) && (void 0 === input.removeCallParams || (Array.isArray(input.removeCallParams) || _assertGuard._assertGuard(_exceptionable, {
937
+ method: "typia.createAssertEquals",
938
+ path: _path + ".removeCallParams",
939
+ expected: "(Array<string> | undefined)",
940
+ value: input.removeCallParams
941
+ }, _errorFactory)) && input.removeCallParams.every((elem, _index14)=>"string" == typeof elem || _assertGuard._assertGuard(_exceptionable, {
942
+ method: "typia.createAssertEquals",
943
+ path: _path + ".removeCallParams[" + _index14 + "]",
944
+ expected: "string",
945
+ value: elem
946
+ }, _errorFactory)) || _assertGuard._assertGuard(_exceptionable, {
947
+ method: "typia.createAssertEquals",
948
+ path: _path + ".removeCallParams",
949
+ expected: "(Array<string> | undefined)",
950
+ value: input.removeCallParams
951
+ }, _errorFactory)) && (0 === Object.keys(input).length || false === _exceptionable || Object.keys(input).every((key)=>{
952
+ if ([
953
+ "pkgName",
954
+ "retainProp",
955
+ "removeCallParams"
956
+ ].some((prop)=>key === prop)) return true;
957
+ const value = input[key];
958
+ if (void 0 === value) return true;
959
+ return _assertGuard._assertGuard(_exceptionable, {
960
+ method: "typia.createAssertEquals",
961
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
962
+ expected: "undefined",
963
+ value: value
964
+ }, _errorFactory);
965
+ }));
966
+ const _ao5 = (input, _path, _exceptionable = true)=>(void 0 === input.define || ("object" == typeof input.define && null !== input.define && false === Array.isArray(input.define) || _assertGuard._assertGuard(_exceptionable, {
967
+ method: "typia.createAssertEquals",
968
+ path: _path + ".define",
969
+ expected: "(Record<string, string> | undefined)",
970
+ value: input.define
971
+ }, _errorFactory)) && _ao6(input.define, _path + ".define", _exceptionable) || _assertGuard._assertGuard(_exceptionable, {
972
+ method: "typia.createAssertEquals",
973
+ path: _path + ".define",
974
+ expected: "(Record<string, string> | undefined)",
975
+ value: input.define
976
+ }, _errorFactory)) && (0 === Object.keys(input).length || false === _exceptionable || Object.keys(input).every((key)=>{
977
+ if ([
978
+ "define"
979
+ ].some((prop)=>key === prop)) return true;
980
+ const value = input[key];
981
+ if (void 0 === value) return true;
982
+ return _assertGuard._assertGuard(_exceptionable, {
983
+ method: "typia.createAssertEquals",
984
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
985
+ expected: "undefined",
986
+ value: value
987
+ }, _errorFactory);
988
+ }));
989
+ const _ao6 = (input, _path, _exceptionable = true)=>false === _exceptionable || Object.keys(input).every((key)=>{
990
+ const value = input[key];
991
+ if (void 0 === value) return true;
992
+ return "string" == typeof value || _assertGuard._assertGuard(_exceptionable, {
993
+ method: "typia.createAssertEquals",
994
+ path: _path + _accessExpressionAsString._accessExpressionAsString(key),
995
+ expected: "string",
996
+ value: value
997
+ }, _errorFactory);
998
+ });
999
+ const __is = (input, _exceptionable = true)=>void 0 === input || "object" == typeof input && null !== input && false === Array.isArray(input) && _io0(input, true);
1000
+ let _errorFactory;
1001
+ return (input, errorFactory = ({ path, expected, value })=>{
1002
+ if ('undefined' === expected) {
1003
+ const errorMessage = `Unknown property: \`${path}\` in the configuration of pluginReactLynx`;
1004
+ return new Error(errorMessage);
1005
+ }
1006
+ return new Error([
1007
+ `Invalid config on pluginReactLynx: \`${path}\`.`,
1008
+ ` - Expect to be ${expected}`,
1009
+ ` - Got: ${whatIs(value)}`,
1010
+ ''
1011
+ ].join('\n'));
1012
+ })=>{
1013
+ if (false === __is(input)) {
1014
+ _errorFactory = errorFactory;
1015
+ ((input, _path, _exceptionable = true)=>void 0 === input || ("object" == typeof input && null !== input && false === Array.isArray(input) || _assertGuard._assertGuard(true, {
1016
+ method: "typia.createAssertEquals",
1017
+ path: _path + "",
1018
+ expected: "(PluginReactLynxOptions | undefined)",
1019
+ value: input
1020
+ }, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard._assertGuard(true, {
1021
+ method: "typia.createAssertEquals",
1022
+ path: _path + "",
1023
+ expected: "(PluginReactLynxOptions | undefined)",
1024
+ value: input
1025
+ }, _errorFactory))(input, "$input", true);
1026
+ }
1027
+ return input;
1028
+ };
1029
+ })();
1030
+ function whatIs(value) {
1031
+ return Object.prototype.toString.call(value).replace(/^\[object\s+([a-z]+)\]$/i, '$1').toLowerCase();
1032
+ }
1033
+ function pluginReactLynx(userOptions) {
1034
+ validateConfig(userOptions);
1035
+ const engineVersion = userOptions?.engineVersion ?? userOptions?.targetSdkVersion ?? '3.2';
1036
+ const defaultOptions = {
1037
+ compat: void 0,
1038
+ customCSSInheritanceList: void 0,
1039
+ debugInfoOutside: true,
1040
+ defaultDisplayLinear: true,
1041
+ enableAccessibilityElement: false,
1042
+ enableICU: false,
1043
+ enableCSSInheritance: false,
1044
+ enableCSSInvalidation: true,
1045
+ enableCSSSelector: true,
1046
+ enableNewGesture: false,
1047
+ enableParallelElement: true,
1048
+ enableRemoveCSSScope: true,
1049
+ firstScreenSyncTiming: 'immediately',
1050
+ jsx: void 0,
1051
+ pipelineSchedulerConfig: 0x00010000,
1052
+ removeDescendantSelectorScope: true,
1053
+ shake: void 0,
1054
+ defineDCE: void 0,
1055
+ targetSdkVersion: '',
1056
+ engineVersion: '',
1057
+ experimental_isLazyBundle: false
1058
+ };
1059
+ const resolvedOptions = Object.assign(defaultOptions, userOptions, {
1060
+ targetSdkVersion: engineVersion,
1061
+ engineVersion
1062
+ });
1063
+ return {
1064
+ name: 'lynx:react',
1065
+ pre: [
1066
+ 'lynx:rsbuild:plugin-api'
1067
+ ],
1068
+ async setup (api) {
1069
+ await applyAlias(api, resolvedOptions.experimental_isLazyBundle);
1070
+ applyCSS(api, resolvedOptions);
1071
+ applyEntry(api, resolvedOptions);
1072
+ applyBackgroundOnly(api);
1073
+ applyLoaders(api, resolvedOptions);
1074
+ applyRefresh(api);
1075
+ applySplitChunksRule(api);
1076
+ applySWC(api);
1077
+ api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
1078
+ config = mergeRsbuildConfig(config, {
1079
+ source: {
1080
+ include: [
1081
+ __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(require.resolve('@lynx-js/react/package.json'))
1082
+ ]
1083
+ }
1084
+ });
1085
+ const userConfig = api.getRsbuildConfig('original');
1086
+ if (void 0 === userConfig.source?.include) return mergeRsbuildConfig(config, {
1087
+ source: {
1088
+ include: [
1089
+ /\.(?:js|mjs|cjs)$/
1090
+ ]
1091
+ }
1092
+ });
1093
+ return config;
1094
+ });
1095
+ if (resolvedOptions.experimental_isLazyBundle) applyLazy(api);
1096
+ const rspeedyAPIs = api.useExposed(Symbol.for('rspeedy.api'));
1097
+ const require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url);
1098
+ const { version } = require('../package.json');
1099
+ rspeedyAPIs.debug(()=>{
1100
+ const webpackPluginPath = require.resolve('@lynx-js/react-webpack-plugin');
1101
+ return `Using @lynx-js/react-webpack-plugin v${version} at ${webpackPluginPath}`;
1102
+ });
1103
+ }
1104
+ };
1105
+ }
1106
+ var __webpack_exports__LAYERS = __WEBPACK_EXTERNAL_MODULE__lynx_js_react_webpack_plugin_1806f3f7__.LAYERS;
1107
+ export { pluginReactLynx, __webpack_exports__LAYERS as LAYERS };