@lynx-js/react-alias-rsbuild-plugin 0.17.1 → 0.18.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/CHANGELOG.md +20 -0
- package/dist/index.js +2 -2
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @lynx-js/react-alias-rsbuild-plugin
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix `Cannot find module '@lynx-js/react/jsx-runtime'` when a stray Yarn PnP manifest (`.pnp.cjs`) exists in an ancestor directory of an npm/pnpm project. Yarn PnP resolution is now only enabled when the build actually runs under the PnP runtime. ([#2920](https://github.com/lynx-family/lynx-stack/pull/2920))
|
|
8
|
+
|
|
9
|
+
## 0.17.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Support enabling preact devtools in production via the `REACT_DEVTOOL` environment variable. ([#2880](https://github.com/lynx-family/lynx-stack/pull/2880))
|
|
14
|
+
|
|
15
|
+
By default `@lynx-js/preact-devtools` is aliased away in production builds. Setting the `REACT_DEVTOOL` environment variable now:
|
|
16
|
+
|
|
17
|
+
1. keeps a user-imported `@lynx-js/preact-devtools` from being stripped;
|
|
18
|
+
2. defines `__REACT_DEVTOOL__`, which gates the dev-only runtime hooks devtools depends on (such as `injectLepusMethods`) so they also run in production;
|
|
19
|
+
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).
|
|
20
|
+
|
|
21
|
+
`@lynx-js/react/debug` remains development-only.
|
|
22
|
+
|
|
3
23
|
## 0.17.1
|
|
4
24
|
|
|
5
25
|
## 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);
|
|
@@ -517,7 +517,7 @@ function createLazyResolver(rspack, directory, conditionNames) {
|
|
|
517
517
|
if (!resolverLazy) {
|
|
518
518
|
const resolver = new ResolverFactory({
|
|
519
519
|
conditionNames,
|
|
520
|
-
enablePnp:
|
|
520
|
+
enablePnp: !!process.versions['pnp']
|
|
521
521
|
});
|
|
522
522
|
resolverLazy = (dir, req)=>resolver.sync(dir, req);
|
|
523
523
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-alias-rsbuild-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "A rsbuild plugin for making alias in ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
],
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@microsoft/api-extractor": "7.58.2",
|
|
36
|
-
"@rsbuild/core": "2.
|
|
37
|
-
"@rspack/core": "2.
|
|
38
|
-
"@rstest/core": "0.
|
|
36
|
+
"@rsbuild/core": "2.1.4",
|
|
37
|
+
"@rspack/core": "2.1.3",
|
|
38
|
+
"@rstest/core": "0.11.0",
|
|
39
39
|
"@types/semver": "^7.7.1",
|
|
40
40
|
"semver": "^7.7.4",
|
|
41
|
-
"@lynx-js/react": "0.
|
|
42
|
-
"@lynx-js/react-webpack-plugin": "0.
|
|
41
|
+
"@lynx-js/react": "0.123.0",
|
|
42
|
+
"@lynx-js/react-webpack-plugin": "0.10.0",
|
|
43
43
|
"@lynx-js/test-tools": "0.0.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|