@lynx-js/react-alias-rsbuild-plugin 0.17.1 → 0.17.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 +14 -0
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lynx-js/react-alias-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.17.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Support enabling preact devtools in production via the `REACT_DEVTOOL` environment variable. ([#2880](https://github.com/lynx-family/lynx-stack/pull/2880))
|
|
8
|
+
|
|
9
|
+
By default `@lynx-js/preact-devtools` is aliased away in production builds. Setting the `REACT_DEVTOOL` environment variable now:
|
|
10
|
+
|
|
11
|
+
1. keeps a user-imported `@lynx-js/preact-devtools` from being stripped;
|
|
12
|
+
2. defines `__REACT_DEVTOOL__`, which gates the dev-only runtime hooks devtools depends on (such as `injectLepusMethods`) so they also run in production;
|
|
13
|
+
3. keeps function/class names during minification (`keep_fnames`/`keep_classnames`), which devtools needs to resolve component names (`type.name`) and to reconstruct the hook tree (it matches minified stack frames by function name).
|
|
14
|
+
|
|
15
|
+
`@lynx-js/react/debug` remains development-only.
|
|
16
|
+
|
|
3
17
|
## 0.17.1
|
|
4
18
|
|
|
5
19
|
## 0.17.0
|
package/dist/index.js
CHANGED
|
@@ -479,7 +479,7 @@ function pluginReactAlias(options) {
|
|
|
479
479
|
for (const [request, value] of resolvedTransformedEntryAliases)chain.resolve.alias.set(request, value);
|
|
480
480
|
if (isProd) {
|
|
481
481
|
chain.resolve.alias.set('@lynx-js/react/debug$', false);
|
|
482
|
-
chain.resolve.alias.set('@lynx-js/preact-devtools$', false);
|
|
482
|
+
if (!process.env['REACT_DEVTOOL']) chain.resolve.alias.set('@lynx-js/preact-devtools$', false);
|
|
483
483
|
}
|
|
484
484
|
if (!chain.resolve.alias.has('react$')) chain.resolve.alias.set('react$', reactLepus.background);
|
|
485
485
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-alias-rsbuild-plugin",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "A rsbuild plugin for making alias in ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@rstest/core": "0.10.5",
|
|
39
39
|
"@types/semver": "^7.7.1",
|
|
40
40
|
"semver": "^7.7.4",
|
|
41
|
-
"@lynx-js/react": "0.122.
|
|
42
|
-
"@lynx-js/react-webpack-plugin": "0.9.
|
|
41
|
+
"@lynx-js/react": "0.122.1",
|
|
42
|
+
"@lynx-js/react-webpack-plugin": "0.9.5",
|
|
43
43
|
"@lynx-js/test-tools": "0.0.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|