@lynx-js/react-alias-rsbuild-plugin 0.10.13 → 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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @lynx-js/react-alias-rsbuild-plugin
2
2
 
3
+ ## 0.10.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Allow customization of the react$ alias. ([#1653](https://github.com/lynx-family/lynx-stack/pull/1653))
8
+
9
+ ```js
10
+ import { defineConfig } from '@lynx-js/rspeedy'
11
+
12
+ export default defineConfig({
13
+ resolve: {
14
+ alias: {
15
+ react$: '@lynx-js/react/compat',
16
+ },
17
+ },
18
+ })
19
+ ```
20
+
3
21
  ## 0.10.13
4
22
 
5
23
  ### Patch Changes
package/dist/index.js CHANGED
@@ -392,6 +392,9 @@ function pluginReactAlias(options) {
392
392
  const resolvePreact = createLazyResolver(reactLynxDir, [
393
393
  'import'
394
394
  ]);
395
+ api.expose(Symbol.for('@lynx-js/react/internal:resolve'), {
396
+ resolve
397
+ });
395
398
  api.modifyRsbuildConfig((config, { mergeRsbuildConfig })=>mergeRsbuildConfig(config, {
396
399
  source: {
397
400
  include: [
@@ -440,7 +443,8 @@ function pluginReactAlias(options) {
440
443
  chain.resolve.alias.set('@lynx-js/react/debug$', false);
441
444
  chain.resolve.alias.set('@lynx-js/preact-devtools$', false);
442
445
  }
443
- chain.resolve.alias.set('react$', reactLepus.background).set('@lynx-js/react$', reactLepus.background);
446
+ if (!chain.resolve.alias.has('react$')) chain.resolve.alias.set('react$', reactLepus.background);
447
+ chain.resolve.alias.set('@lynx-js/react$', reactLepus.background);
444
448
  if (reactCompat) chain.resolve.alias.set('@lynx-js/react/compat$', reactCompat);
445
449
  const preactEntries = [
446
450
  'preact',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-alias-rsbuild-plugin",
3
- "version": "0.10.13",
3
+ "version": "0.10.14",
4
4
  "description": "A rsbuild plugin for making alias in ReactLynx",
5
5
  "keywords": [
6
6
  "rsbuild",
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@microsoft/api-extractor": "7.52.11",
39
- "@rsbuild/core": "1.4.15",
39
+ "@rsbuild/core": "1.5.4",
40
40
  "@types/semver": "^7.7.0",
41
41
  "semver": "^7.7.2",
42
- "@lynx-js/react": "0.112.4",
43
- "@lynx-js/react-webpack-plugin": "0.6.20",
42
+ "@lynx-js/react": "0.113.0",
43
+ "@lynx-js/react-webpack-plugin": "0.7.0",
44
44
  "@lynx-js/vitest-setup": "0.0.0"
45
45
  },
46
46
  "engines": {