@lynx-js/react-alias-rsbuild-plugin 0.16.1 → 0.16.2
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 +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -349,7 +349,7 @@ const gte = __webpack_require__("../../../node_modules/.pnpm/semver@7.7.4/node_m
|
|
|
349
349
|
var gte_default = /*#__PURE__*/ __webpack_require__.n(gte);
|
|
350
350
|
const S_PLUGIN_REACT_ALIAS = Symbol.for('@lynx-js/plugin-react-alias');
|
|
351
351
|
function pluginReactAlias(options) {
|
|
352
|
-
const { LAYERS, lazy, rootPath } = options ?? {};
|
|
352
|
+
const { LAYERS, lazy, rootPath, elementTemplate } = options ?? {};
|
|
353
353
|
return {
|
|
354
354
|
name: 'lynx:react-alias',
|
|
355
355
|
setup (api) {
|
|
@@ -385,25 +385,29 @@ function pluginReactAlias(options) {
|
|
|
385
385
|
Object.defineProperty(environment, S_PLUGIN_REACT_ALIAS, {
|
|
386
386
|
value: true
|
|
387
387
|
});
|
|
388
|
-
const [jsxRuntimeBackground, jsxRuntimeMainThread, jsxDevRuntimeBackground, jsxDevRuntimeMainThread, preactHooks, hooksBackground, hooksMainThread, reactLepusBackground, reactLepusMainThread, reactCompat] = await Promise.all([
|
|
388
|
+
const [jsxRuntimeBackground, jsxRuntimeMainThread, jsxDevRuntimeBackground, jsxDevRuntimeMainThread, elementTemplateJsxRuntime, elementTemplateJsxDevRuntime, preactHooks, hooksBackground, hooksMainThread, reactLepusBackground, reactLepusMainThread, reactCompat, elementTemplateEntry, elementTemplateInternalEntry] = await Promise.all([
|
|
389
389
|
resolve('@lynx-js/react/jsx-runtime'),
|
|
390
390
|
resolve('@lynx-js/react/lepus/jsx-runtime'),
|
|
391
391
|
resolve('@lynx-js/react/jsx-dev-runtime'),
|
|
392
392
|
resolve('@lynx-js/react/lepus/jsx-dev-runtime'),
|
|
393
|
+
elementTemplate ? resolve('@lynx-js/react/element-template/jsx-runtime') : Promise.resolve(null),
|
|
394
|
+
elementTemplate ? resolve('@lynx-js/react/element-template/jsx-dev-runtime') : Promise.resolve(null),
|
|
393
395
|
resolvePreact('preact/hooks'),
|
|
394
396
|
resolve('@lynx-js/react/hooks'),
|
|
395
397
|
resolve('@lynx-js/react/lepus/hooks'),
|
|
396
398
|
resolve('@lynx-js/react'),
|
|
397
399
|
resolve('@lynx-js/react/lepus'),
|
|
398
|
-
gte_default()(version, '0.111.9999') ? resolve('@lynx-js/react/compat') : Promise.resolve(null)
|
|
400
|
+
gte_default()(version, '0.111.9999') ? resolve('@lynx-js/react/compat') : Promise.resolve(null),
|
|
401
|
+
elementTemplate ? resolve('@lynx-js/react/element-template') : Promise.resolve(null),
|
|
402
|
+
elementTemplate ? resolve('@lynx-js/react/element-template/internal') : Promise.resolve(null)
|
|
399
403
|
]);
|
|
400
404
|
const jsxRuntime = {
|
|
401
405
|
background: jsxRuntimeBackground,
|
|
402
|
-
mainThread: jsxRuntimeMainThread
|
|
406
|
+
mainThread: elementTemplateJsxRuntime ?? jsxRuntimeMainThread
|
|
403
407
|
};
|
|
404
408
|
const jsxDevRuntime = {
|
|
405
409
|
background: jsxDevRuntimeBackground,
|
|
406
|
-
mainThread: jsxDevRuntimeMainThread
|
|
410
|
+
mainThread: elementTemplateJsxDevRuntime ?? jsxDevRuntimeMainThread
|
|
407
411
|
};
|
|
408
412
|
const reactLepus = {
|
|
409
413
|
background: reactLepusBackground,
|
|
@@ -430,7 +434,7 @@ function pluginReactAlias(options) {
|
|
|
430
434
|
chain.resolve.alias.set('@lynx-js/preact-devtools$', false);
|
|
431
435
|
}
|
|
432
436
|
if (!chain.resolve.alias.has('react$')) chain.resolve.alias.set('react$', reactLepus.background);
|
|
433
|
-
chain.resolve.alias.set('@lynx-js/react$', reactLepus.background).set('@lynx-js/react/jsx-runtime', jsxRuntime.background).set('@lynx-js/react/jsx-dev-runtime', jsxDevRuntime.background);
|
|
437
|
+
chain.resolve.alias.set('@lynx-js/react$', elementTemplateEntry ?? reactLepus.background).set('@lynx-js/react/internal$', elementTemplateInternalEntry ?? chain.resolve.alias.get('@lynx-js/react/internal$')).set('@lynx-js/react/jsx-runtime', jsxRuntime.background).set('@lynx-js/react/jsx-dev-runtime', jsxDevRuntime.background);
|
|
434
438
|
if (reactCompat) chain.resolve.alias.set('@lynx-js/react/compat$', reactCompat);
|
|
435
439
|
const preactEntries = [
|
|
436
440
|
'preact',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-alias-rsbuild-plugin",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "A rsbuild plugin for making alias in ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@rspack/core": "1.7.9",
|
|
38
38
|
"@types/semver": "^7.7.1",
|
|
39
39
|
"semver": "^7.7.4",
|
|
40
|
-
"@lynx-js/react": "0.
|
|
40
|
+
"@lynx-js/react": "0.121.0",
|
|
41
41
|
"@lynx-js/react-webpack-plugin": "0.9.2",
|
|
42
42
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
43
43
|
},
|