@lynx-js/react-rsbuild-plugin 0.10.12 → 0.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/{860.js → 856.js} +2 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +79 -80
- package/package.json +16 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.10.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix using wrong version of `@lynx-js/react/worklet-runtime`. ([#1711](https://github.com/lynx-family/lynx-stack/pull/1711))
|
|
8
|
+
|
|
9
|
+
- Be compat with `@lynx-js/react` v0.113.0 ([#1667](https://github.com/lynx-family/lynx-stack/pull/1667))
|
|
10
|
+
|
|
11
|
+
- Disable `builtin:lightningcss-loader` for `environments.web`. ([#1732](https://github.com/lynx-family/lynx-stack/pull/1732))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`5ad38e6`](https://github.com/lynx-family/lynx-stack/commit/5ad38e6b3970a537f13d7f4caf0d765d16b6b322), [`69b3ae0`](https://github.com/lynx-family/lynx-stack/commit/69b3ae031a24161b8513cc804bf6b82c03da6d0c), [`69b3ae0`](https://github.com/lynx-family/lynx-stack/commit/69b3ae031a24161b8513cc804bf6b82c03da6d0c), [`c2f90bd`](https://github.com/lynx-family/lynx-stack/commit/c2f90bdb0ce465702b0b4a46108b16e78678225f)]:
|
|
14
|
+
- @lynx-js/template-webpack-plugin@0.8.6
|
|
15
|
+
- @lynx-js/react-webpack-plugin@0.7.0
|
|
16
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.14
|
|
17
|
+
- @lynx-js/css-extract-webpack-plugin@0.6.2
|
|
18
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
19
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
20
|
+
|
|
21
|
+
## 0.10.13
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Support using multiple times in different environments. ([#1498](https://github.com/lynx-family/lynx-stack/pull/1498))
|
|
26
|
+
|
|
27
|
+
- Support caching Lynx native events when chunk splitting is enabled. ([#1370](https://github.com/lynx-family/lynx-stack/pull/1370))
|
|
28
|
+
|
|
29
|
+
When `performance.chunkSplit.strategy` is not `all-in-one`, Lynx native events are cached until the BTS chunk is fully loaded and are replayed when that chunk is ready. The `firstScreenSyncTiming` flag will no longer change to `jsReady` anymore.
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`f0d483c`](https://github.com/lynx-family/lynx-stack/commit/f0d483ca2d3e208a618727590061b0babc075737), [`e4d116b`](https://github.com/lynx-family/lynx-stack/commit/e4d116b6e5eaf49ced08c505c99f7e878a58dfb1), [`d33c1d2`](https://github.com/lynx-family/lynx-stack/commit/d33c1d27827f5e1ebc553447dabe5080671de94a)]:
|
|
32
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.13
|
|
33
|
+
- @lynx-js/template-webpack-plugin@0.8.5
|
|
34
|
+
- @lynx-js/react-webpack-plugin@0.6.20
|
|
35
|
+
- @lynx-js/runtime-wrapper-webpack-plugin@0.1.3
|
|
36
|
+
- @lynx-js/use-sync-external-store@1.5.0
|
|
37
|
+
- @lynx-js/react-refresh-webpack-plugin@0.3.4
|
|
38
|
+
- @lynx-js/css-extract-webpack-plugin@0.6.2
|
|
39
|
+
|
|
3
40
|
## 0.10.12
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
package/dist/{860.js → 856.js}
RENAMED
package/dist/index.d.ts
CHANGED
|
@@ -426,7 +426,7 @@ export { LAYERS }
|
|
|
426
426
|
*
|
|
427
427
|
* @public
|
|
428
428
|
*/
|
|
429
|
-
export declare function pluginReactLynx(userOptions?: PluginReactLynxOptions): RsbuildPlugin;
|
|
429
|
+
export declare function pluginReactLynx(userOptions?: PluginReactLynxOptions): RsbuildPlugin[];
|
|
430
430
|
|
|
431
431
|
/**
|
|
432
432
|
* Options of {@link pluginReactLynx}
|
|
@@ -441,7 +441,7 @@ export declare interface PluginReactLynxOptions {
|
|
|
441
441
|
*
|
|
442
442
|
* These options should only be used for migrating from ReactLynx2.0.
|
|
443
443
|
*/
|
|
444
|
-
compat?: Partial<CompatVisitorConfig> & {
|
|
444
|
+
compat?: (Partial<CompatVisitorConfig> & {
|
|
445
445
|
/**
|
|
446
446
|
* Whether disable runtime warnings about using ReactLynx2.0-incompatible `SelectorQuery` APIs.
|
|
447
447
|
*
|
|
@@ -458,7 +458,7 @@ export declare interface PluginReactLynxOptions {
|
|
|
458
458
|
* @defaultValue `false`
|
|
459
459
|
*/
|
|
460
460
|
disableCreateSelectorQueryIncompatibleWarning?: boolean;
|
|
461
|
-
} | undefined;
|
|
461
|
+
}) | undefined;
|
|
462
462
|
/**
|
|
463
463
|
* When {@link PluginReactLynxOptions.enableCSSInheritance} is enabled, `customCSSInheritanceList` can control which properties are inheritable, not just the default ones.
|
|
464
464
|
*
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { LAYERS, ReactWebpackPlugin } from "@lynx-js/react-webpack-plugin";
|
|
6
|
-
import { CSSPlugins, LynxEncodePlugin, LynxTemplatePlugin, WebEncodePlugin } from "@lynx-js/template-webpack-plugin";
|
|
7
6
|
import { RuntimeWrapperWebpackPlugin } from "@lynx-js/runtime-wrapper-webpack-plugin";
|
|
7
|
+
import { LynxEncodePlugin, LynxTemplatePlugin, WebEncodePlugin } from "@lynx-js/template-webpack-plugin";
|
|
8
8
|
import { ReactRefreshRspackPlugin, ReactRefreshWebpackPlugin } from "@lynx-js/react-refresh-webpack-plugin";
|
|
9
9
|
var __webpack_modules__ = {
|
|
10
|
-
"../../../node_modules/.pnpm/typia@9.7.
|
|
10
|
+
"../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_accessExpressionAsString.js": function(__unused_webpack_module, exports) {
|
|
11
11
|
exports._accessExpressionAsString = void 0;
|
|
12
12
|
const _accessExpressionAsString = (str)=>variable(str) ? `.${str}` : `[${JSON.stringify(str)}]`;
|
|
13
13
|
exports._accessExpressionAsString = _accessExpressionAsString;
|
|
@@ -52,9 +52,9 @@ var __webpack_modules__ = {
|
|
|
52
52
|
"with"
|
|
53
53
|
]);
|
|
54
54
|
},
|
|
55
|
-
"../../../node_modules/.pnpm/typia@9.7.
|
|
55
|
+
"../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_assertGuard.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
56
56
|
exports._assertGuard = void 0;
|
|
57
|
-
const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.
|
|
57
|
+
const TypeGuardError_1 = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/TypeGuardError.mjs");
|
|
58
58
|
const _assertGuard = (exceptionable, props, factory)=>{
|
|
59
59
|
if (true === exceptionable) if (factory) throw factory(props);
|
|
60
60
|
else throw new TypeGuardError_1.TypeGuardError(props);
|
|
@@ -71,7 +71,7 @@ var __webpack_modules__ = {
|
|
|
71
71
|
"node:url": function(module) {
|
|
72
72
|
module.exports = __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__;
|
|
73
73
|
},
|
|
74
|
-
"../../../node_modules/.pnpm/typia@9.7.
|
|
74
|
+
"../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/TypeGuardError.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
75
75
|
__webpack_require__.r(__webpack_exports__);
|
|
76
76
|
__webpack_require__.d(__webpack_exports__, {
|
|
77
77
|
TypeGuardError: ()=>TypeGuardError
|
|
@@ -81,6 +81,7 @@ var __webpack_modules__ = {
|
|
|
81
81
|
path;
|
|
82
82
|
expected;
|
|
83
83
|
value;
|
|
84
|
+
description;
|
|
84
85
|
fake_expected_typed_value_;
|
|
85
86
|
constructor(props){
|
|
86
87
|
super(props.message || `Error on ${props.method}(): invalid type${props.path ? ` on ${props.path}` : ""}, expect to be ${props.expected}`);
|
|
@@ -91,6 +92,11 @@ var __webpack_modules__ = {
|
|
|
91
92
|
this.path = props.path;
|
|
92
93
|
this.expected = props.expected;
|
|
93
94
|
this.value = props.value;
|
|
95
|
+
if (props.description || void 0 === props.value) this.description = props.description ?? [
|
|
96
|
+
"The value at this path is `undefined`.",
|
|
97
|
+
"",
|
|
98
|
+
`Please fill the \`${props.expected}\` typed value next time.`
|
|
99
|
+
].join("\n");
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
102
|
}
|
|
@@ -139,7 +145,7 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
139
145
|
})();
|
|
140
146
|
(()=>{
|
|
141
147
|
var installedChunks = {
|
|
142
|
-
|
|
148
|
+
410: 0
|
|
143
149
|
};
|
|
144
150
|
var installChunk = (data)=>{
|
|
145
151
|
var __webpack_ids__ = data.__webpack_ids__;
|
|
@@ -175,13 +181,6 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
175
181
|
};
|
|
176
182
|
})();
|
|
177
183
|
var react_alias_rsbuild_plugin_ = __webpack_require__("@lynx-js/react-alias-rsbuild-plugin");
|
|
178
|
-
function applyAlias(api, lazy) {
|
|
179
|
-
return (0, react_alias_rsbuild_plugin_.pluginReactAlias)({
|
|
180
|
-
LAYERS: LAYERS,
|
|
181
|
-
lazy,
|
|
182
|
-
rootPath: api.context.rootPath
|
|
183
|
-
}).setup(api);
|
|
184
|
-
}
|
|
185
184
|
var external_node_path_ = __webpack_require__("node:path");
|
|
186
185
|
var external_node_url_ = __webpack_require__("node:url");
|
|
187
186
|
const DETECT_IMPORT_ERROR = 'react:detect-import-error';
|
|
@@ -190,7 +189,7 @@ const ALIAS_BACKGROUND_ONLY_BACKGROUND = 'react:alias-background-only-background
|
|
|
190
189
|
function applyBackgroundOnly(api) {
|
|
191
190
|
api.modifyBundlerChain(async (chain)=>{
|
|
192
191
|
const __dirname = external_node_path_["default"].dirname((0, external_node_url_.fileURLToPath)(import.meta.url));
|
|
193
|
-
const { resolve, resolveMainThread } = await __webpack_require__.e("
|
|
192
|
+
const { resolve, resolveMainThread } = await __webpack_require__.e("856").then(__webpack_require__.bind(__webpack_require__, "./src/resolve.ts"));
|
|
194
193
|
const [backgroundOnly, backgroundOnlyMainThread] = await Promise.all([
|
|
195
194
|
resolve('background-only'),
|
|
196
195
|
resolveMainThread('background-only')
|
|
@@ -210,7 +209,7 @@ function applyCSS(api, options) {
|
|
|
210
209
|
}
|
|
211
210
|
}));
|
|
212
211
|
const __dirname = external_node_path_["default"].dirname((0, external_node_url_.fileURLToPath)(import.meta.url));
|
|
213
|
-
api.modifyBundlerChain(async function(chain, { CHAIN_ID
|
|
212
|
+
api.modifyBundlerChain(async function(chain, { CHAIN_ID }) {
|
|
214
213
|
const { CssExtractRspackPlugin, CssExtractWebpackPlugin } = await import("@lynx-js/css-extract-webpack-plugin");
|
|
215
214
|
const CssExtractPlugin = 'rspack' === api.context.bundlerType ? CssExtractRspackPlugin : CssExtractWebpackPlugin;
|
|
216
215
|
const cssRules = [
|
|
@@ -239,7 +238,7 @@ function applyCSS(api, options) {
|
|
|
239
238
|
removeLightningCSS(rule);
|
|
240
239
|
});
|
|
241
240
|
function removeLightningCSS(rule) {
|
|
242
|
-
if (rule.uses.has(CHAIN_ID.USE.LIGHTNINGCSS)
|
|
241
|
+
if (rule.uses.has(CHAIN_ID.USE.LIGHTNINGCSS)) rule.uses.delete(CHAIN_ID.USE.LIGHTNINGCSS);
|
|
243
242
|
}
|
|
244
243
|
chain.plugin(CHAIN_ID.PLUGIN.MINI_CSS_EXTRACT).tap(([options])=>[
|
|
245
244
|
{
|
|
@@ -248,9 +247,7 @@ function applyCSS(api, options) {
|
|
|
248
247
|
enableCSSSelector,
|
|
249
248
|
enableCSSInvalidation,
|
|
250
249
|
targetSdkVersion,
|
|
251
|
-
cssPlugins: [
|
|
252
|
-
CSSPlugins.parserPlugins.removeFunctionWhiteSpace()
|
|
253
|
-
]
|
|
250
|
+
cssPlugins: []
|
|
254
251
|
}
|
|
255
252
|
]).init((_, args)=>new CssExtractPlugin(...args)).end().end();
|
|
256
253
|
chain.module.when(void 0 === enableRemoveCSSScope, (module)=>module.rule('lynx.css.scoped').test(/\.css$/).resourceQuery({
|
|
@@ -289,7 +286,7 @@ const EMPTY_HASH = '';
|
|
|
289
286
|
function applyEntry(api, options) {
|
|
290
287
|
const { compat, customCSSInheritanceList, debugInfoOutside, defaultDisplayLinear, enableAccessibilityElement, enableICU, enableCSSInheritance, enableCSSInvalidation, enableCSSSelector, enableNewGesture, enableParallelElement, enableRemoveCSSScope, firstScreenSyncTiming, enableSSR, pipelineSchedulerConfig, removeDescendantSelectorScope, targetSdkVersion, extractStr: originalExtractStr, experimental_isLazyBundle } = options;
|
|
291
288
|
const { config, logger } = api.useExposed(Symbol.for('rspeedy.api'));
|
|
292
|
-
api.modifyBundlerChain((chain, { environment, isDev, isProd })=>{
|
|
289
|
+
api.modifyBundlerChain(async (chain, { environment, isDev, isProd })=>{
|
|
293
290
|
const entries = chain.entryPoints.entries() ?? {};
|
|
294
291
|
const isLynx = 'lynx' === environment.name;
|
|
295
292
|
const isWeb = 'web' === environment.name;
|
|
@@ -353,20 +350,16 @@ function applyEntry(api, options) {
|
|
|
353
350
|
removeDescendantSelectorScope,
|
|
354
351
|
targetSdkVersion,
|
|
355
352
|
experimental_isLazyBundle,
|
|
356
|
-
cssPlugins: [
|
|
357
|
-
CSSPlugins.parserPlugins.removeFunctionWhiteSpace()
|
|
358
|
-
]
|
|
353
|
+
cssPlugins: []
|
|
359
354
|
}
|
|
360
355
|
]).end();
|
|
361
356
|
});
|
|
362
357
|
const rsbuildConfig = api.getRsbuildConfig();
|
|
363
358
|
const userConfig = api.getRsbuildConfig('original');
|
|
364
359
|
const enableChunkSplitting = rsbuildConfig.performance?.chunkSplit?.strategy !== 'all-in-one';
|
|
365
|
-
let finalFirstScreenSyncTiming = firstScreenSyncTiming;
|
|
366
360
|
if (isLynx) {
|
|
367
361
|
let inlineScripts;
|
|
368
362
|
inlineScripts = experimental_isLazyBundle ? true : environment.config.output?.inlineScripts ?? !enableChunkSplitting;
|
|
369
|
-
if (true !== inlineScripts) finalFirstScreenSyncTiming = 'jsReady';
|
|
370
363
|
chain.plugin(PLUGIN_NAME_RUNTIME_WRAPPER).use(RuntimeWrapperWebpackPlugin, [
|
|
371
364
|
{
|
|
372
365
|
injectVars (vars) {
|
|
@@ -397,15 +390,17 @@ function applyEntry(api, options) {
|
|
|
397
390
|
logger.warn('`extractStr` is changed to `false` because it is only supported in `all-in-one` chunkSplit strategy, please set `performance.chunkSplit.strategy` to `all-in-one` to use `extractStr.`');
|
|
398
391
|
extractStr = false;
|
|
399
392
|
}
|
|
393
|
+
const { resolve } = api.useExposed(Symbol.for('@lynx-js/react/internal:resolve'));
|
|
400
394
|
chain.plugin(PLUGIN_NAME_REACT).after(PLUGIN_NAME_TEMPLATE).use(ReactWebpackPlugin, [
|
|
401
395
|
{
|
|
402
396
|
disableCreateSelectorQueryIncompatibleWarning: compat?.disableCreateSelectorQueryIncompatibleWarning ?? false,
|
|
403
|
-
firstScreenSyncTiming
|
|
397
|
+
firstScreenSyncTiming,
|
|
404
398
|
enableSSR,
|
|
405
399
|
mainThreadChunks,
|
|
406
400
|
extractStr,
|
|
407
401
|
experimental_isLazyBundle,
|
|
408
|
-
profile: getDefaultProfile()
|
|
402
|
+
profile: getDefaultProfile(),
|
|
403
|
+
workletRuntimePath: await resolve(`@lynx-js/react/${isDev ? 'worklet-dev-runtime' : 'worklet-runtime'}`)
|
|
409
404
|
}
|
|
410
405
|
]);
|
|
411
406
|
function getDefaultProfile() {
|
|
@@ -567,8 +562,7 @@ const applySplitChunksRule = (api)=>{
|
|
|
567
562
|
}
|
|
568
563
|
});
|
|
569
564
|
});
|
|
570
|
-
api.modifyRspackConfig((rspackConfig
|
|
571
|
-
if ('lynx' !== environment.name) return rspackConfig;
|
|
565
|
+
api.modifyRspackConfig((rspackConfig)=>{
|
|
572
566
|
if (!rspackConfig.optimization) return rspackConfig;
|
|
573
567
|
if (!rspackConfig.optimization.splitChunks) return rspackConfig;
|
|
574
568
|
rspackConfig.optimization.splitChunks.chunks = function(chunk) {
|
|
@@ -600,7 +594,7 @@ function applySWC(api) {
|
|
|
600
594
|
}
|
|
601
595
|
function applyUseSyncExternalStore(api) {
|
|
602
596
|
api.modifyBundlerChain(async (chain)=>{
|
|
603
|
-
const { resolve } = await __webpack_require__.e("
|
|
597
|
+
const { resolve } = await __webpack_require__.e("856").then(__webpack_require__.bind(__webpack_require__, "./src/resolve.ts"));
|
|
604
598
|
const useSyncExternalStoreEntries = [
|
|
605
599
|
'use-sync-external-store',
|
|
606
600
|
'use-sync-external-store/with-selector',
|
|
@@ -612,8 +606,8 @@ function applyUseSyncExternalStore(api) {
|
|
|
612
606
|
})));
|
|
613
607
|
});
|
|
614
608
|
}
|
|
615
|
-
var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.
|
|
616
|
-
var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.
|
|
609
|
+
var _accessExpressionAsString = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_accessExpressionAsString.js");
|
|
610
|
+
var _assertGuard = __webpack_require__("../../../node_modules/.pnpm/typia@9.7.2_typescript@5.9.2/node_modules/typia/lib/internal/_assertGuard.js");
|
|
617
611
|
const validateConfig = (()=>{
|
|
618
612
|
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.enableSSR || "boolean" == typeof input.enableSSR) && (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) && null !== input.extractStr && (void 0 === input.extractStr || "boolean" == typeof input.extractStr || "object" == typeof input.extractStr && null !== input.extractStr && false === Array.isArray(input.extractStr) && _io7(input.extractStr, _exceptionable)) && (void 0 === input.experimental_isLazyBundle || "boolean" == typeof input.experimental_isLazyBundle) && (0 === Object.keys(input).length || Object.keys(input).every((key)=>{
|
|
619
613
|
if ([
|
|
@@ -1221,56 +1215,61 @@ function pluginReactLynx(userOptions) {
|
|
|
1221
1215
|
targetSdkVersion: engineVersion,
|
|
1222
1216
|
engineVersion
|
|
1223
1217
|
});
|
|
1224
|
-
return
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1218
|
+
return [
|
|
1219
|
+
(0, react_alias_rsbuild_plugin_.pluginReactAlias)({
|
|
1220
|
+
lazy: resolvedOptions.experimental_isLazyBundle,
|
|
1221
|
+
LAYERS: LAYERS
|
|
1222
|
+
}),
|
|
1223
|
+
{
|
|
1224
|
+
name: 'lynx:react',
|
|
1225
|
+
pre: [
|
|
1226
|
+
'lynx:rsbuild:plugin-api'
|
|
1227
|
+
],
|
|
1228
|
+
setup (api) {
|
|
1229
|
+
applyCSS(api, resolvedOptions);
|
|
1230
|
+
applyEntry(api, resolvedOptions);
|
|
1231
|
+
applyBackgroundOnly(api);
|
|
1232
|
+
applyGenerator(api, resolvedOptions);
|
|
1233
|
+
applyLoaders(api, resolvedOptions);
|
|
1234
|
+
applyRefresh(api);
|
|
1235
|
+
applySplitChunksRule(api);
|
|
1236
|
+
applySWC(api);
|
|
1237
|
+
applyUseSyncExternalStore(api);
|
|
1238
|
+
api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>{
|
|
1239
|
+
const userConfig = api.getRsbuildConfig('original');
|
|
1240
|
+
if (void 0 === userConfig.source?.include) config = mergeRsbuildConfig(config, {
|
|
1241
|
+
source: {
|
|
1242
|
+
include: [
|
|
1243
|
+
/\.(?:js|mjs|cjs)$/
|
|
1244
|
+
]
|
|
1245
|
+
}
|
|
1246
|
+
});
|
|
1247
|
+
if (void 0 === userConfig.output?.inlineScripts) config = mergeRsbuildConfig(config, {
|
|
1248
|
+
output: {
|
|
1249
|
+
inlineScripts: true
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
config = mergeRsbuildConfig({
|
|
1253
|
+
tools: {
|
|
1254
|
+
rspack: {
|
|
1255
|
+
output: {
|
|
1256
|
+
iife: false
|
|
1257
|
+
}
|
|
1259
1258
|
}
|
|
1260
1259
|
}
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
}
|
|
1260
|
+
}, config);
|
|
1261
|
+
return config;
|
|
1262
|
+
});
|
|
1263
|
+
if (resolvedOptions.experimental_isLazyBundle) applyLazy(api);
|
|
1264
|
+
const rspeedyAPIs = api.useExposed(Symbol.for('rspeedy.api'));
|
|
1265
|
+
const require = createRequire(import.meta.url);
|
|
1266
|
+
const { version } = require('../package.json');
|
|
1267
|
+
rspeedyAPIs.debug(()=>{
|
|
1268
|
+
const webpackPluginPath = require.resolve('@lynx-js/react-webpack-plugin');
|
|
1269
|
+
return `Using @lynx-js/react-webpack-plugin v${version} at ${webpackPluginPath}`;
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1273
1272
|
}
|
|
1274
|
-
|
|
1273
|
+
];
|
|
1275
1274
|
}
|
|
1276
1275
|
export { LAYERS, pluginReactLynx };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.14",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,31 +33,33 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@lynx-js/css-extract-webpack-plugin": "0.6.2",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "0.10.
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "0.10.14",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "0.3.4",
|
|
38
|
-
"@lynx-js/react-webpack-plugin": "0.
|
|
39
|
-
"@lynx-js/runtime-wrapper-webpack-plugin": "0.1.
|
|
40
|
-
"@lynx-js/template-webpack-plugin": "0.8.
|
|
38
|
+
"@lynx-js/react-webpack-plugin": "0.7.0",
|
|
39
|
+
"@lynx-js/runtime-wrapper-webpack-plugin": "0.1.3",
|
|
40
|
+
"@lynx-js/template-webpack-plugin": "0.8.6",
|
|
41
41
|
"@lynx-js/use-sync-external-store": "1.5.0",
|
|
42
42
|
"background-only": "^0.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "7.52.
|
|
45
|
+
"@microsoft/api-extractor": "7.52.11",
|
|
46
46
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
47
|
-
"@rsbuild/core": "1.4
|
|
48
|
-
"@rsbuild/plugin-sass": "1.
|
|
49
|
-
"@rsbuild/plugin-typed-css-modules": "1.0
|
|
47
|
+
"@rsbuild/core": "1.5.4",
|
|
48
|
+
"@rsbuild/plugin-sass": "1.4.0",
|
|
49
|
+
"@rsbuild/plugin-typed-css-modules": "1.1.0",
|
|
50
|
+
"rsbuild-plugin-arethetypeswrong": "0.1.1",
|
|
51
|
+
"rsbuild-plugin-publint": "0.3.3",
|
|
50
52
|
"tailwindcss": "^3.4.17",
|
|
51
53
|
"type-fest": "^4.41.0",
|
|
52
|
-
"typia": "9.7.
|
|
53
|
-
"typia-rspack-plugin": "2.2.
|
|
54
|
-
"@lynx-js/react": "0.
|
|
54
|
+
"typia": "9.7.2",
|
|
55
|
+
"typia-rspack-plugin": "2.2.2",
|
|
56
|
+
"@lynx-js/react": "0.113.0",
|
|
55
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
56
|
-
"@lynx-js/rspeedy": "0.
|
|
58
|
+
"@lynx-js/rspeedy": "0.11.2",
|
|
57
59
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
58
60
|
},
|
|
59
61
|
"peerDependencies": {
|
|
60
|
-
"@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0"
|
|
62
|
+
"@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0 || ^0.111.0 || ^0.112.0 || ^0.113.0"
|
|
61
63
|
},
|
|
62
64
|
"peerDependenciesMeta": {
|
|
63
65
|
"@lynx-js/react": {
|