@lynx-js/react-rsbuild-plugin-canary 0.10.1-canary-20250526-9ed1bb97 → 0.10.1
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 +31 -31
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @lynx-js/react-rsbuild-plugin
|
|
2
2
|
|
|
3
|
-
## 0.10.1
|
|
3
|
+
## 0.10.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- The default value of `output.inlineScripts` should be `true` on `@lynx-js/rspeedy` <= v0.9.6. ([#
|
|
7
|
+
- The default value of `output.inlineScripts` should be `true` on `@lynx-js/rspeedy` <= v0.9.6. ([#923](https://github.com/lynx-family/lynx-stack/pull/923))
|
|
8
8
|
|
|
9
9
|
- Updated dependencies []:
|
|
10
|
-
- @lynx-js/react-alias-rsbuild-plugin@0.10.1
|
|
10
|
+
- @lynx-js/react-alias-rsbuild-plugin@0.10.1
|
|
11
11
|
|
|
12
12
|
## 0.10.0
|
|
13
13
|
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
example:
|
|
25
25
|
|
|
26
26
|
```js
|
|
27
|
-
import { defineConfig } from
|
|
27
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
28
28
|
|
|
29
29
|
export default defineConfig({
|
|
30
30
|
output: {
|
|
31
31
|
inlineScripts: false,
|
|
32
32
|
},
|
|
33
|
-
})
|
|
33
|
+
})
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
- Support `@lynx-js/react` v0.109.0. ([#840](https://github.com/lynx-family/lynx-stack/pull/840))
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
Now you can override configuration like `useDefineForClassFields` using `tools.swc`.
|
|
118
118
|
|
|
119
119
|
```js
|
|
120
|
-
import { defineConfig } from
|
|
120
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
121
121
|
|
|
122
122
|
export default defineConfig({
|
|
123
123
|
tools: {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
},
|
|
130
130
|
},
|
|
131
131
|
},
|
|
132
|
-
})
|
|
132
|
+
})
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
- Updated dependencies [[`f1ca29b`](https://github.com/lynx-family/lynx-stack/commit/f1ca29bd766377dd46583f15e1e75bca447699cd)]:
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
You may turn it off using `output.minify.css: false`:
|
|
306
306
|
|
|
307
307
|
```js
|
|
308
|
-
import { defineConfig } from
|
|
308
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
309
309
|
|
|
310
310
|
export default defineConfig({
|
|
311
311
|
output: {
|
|
@@ -313,18 +313,18 @@
|
|
|
313
313
|
css: false,
|
|
314
314
|
},
|
|
315
315
|
},
|
|
316
|
-
})
|
|
316
|
+
})
|
|
317
317
|
```
|
|
318
318
|
|
|
319
319
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
320
320
|
|
|
321
321
|
```js
|
|
322
|
-
import { defineConfig } from
|
|
323
|
-
import { pluginCssMinimizer } from
|
|
322
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
323
|
+
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer'
|
|
324
324
|
|
|
325
325
|
export default defineConfig({
|
|
326
326
|
plugins: [pluginCssMinimizer()],
|
|
327
|
-
})
|
|
327
|
+
})
|
|
328
328
|
```
|
|
329
329
|
|
|
330
330
|
### Patch Changes
|
|
@@ -404,18 +404,18 @@
|
|
|
404
404
|
- e8039f2: Add `defineDCE` in plugin options. Often used to define custom macros.
|
|
405
405
|
|
|
406
406
|
```js
|
|
407
|
-
import { pluginReactLynx } from
|
|
408
|
-
import { defineConfig } from
|
|
407
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
408
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
409
409
|
|
|
410
410
|
export default defineConfig({
|
|
411
411
|
plugins: [
|
|
412
412
|
pluginReactLynx({
|
|
413
413
|
defineDCE: {
|
|
414
|
-
__SOME_FALSE_DEFINE__:
|
|
414
|
+
__SOME_FALSE_DEFINE__: 'false',
|
|
415
415
|
},
|
|
416
416
|
}),
|
|
417
417
|
],
|
|
418
|
-
})
|
|
418
|
+
})
|
|
419
419
|
```
|
|
420
420
|
|
|
421
421
|
Different from `define` provided by bundlers like webpack, `defineDCE` works at transform time and a extra DCE (Dead Code Elimination) pass will be performed.
|
|
@@ -423,20 +423,20 @@
|
|
|
423
423
|
For example, `import` initialized by dead code will be removed:
|
|
424
424
|
|
|
425
425
|
```js
|
|
426
|
-
import { foo } from
|
|
426
|
+
import { foo } from 'bar'
|
|
427
427
|
|
|
428
428
|
if (__SOME_FALSE_DEFINE__) {
|
|
429
|
-
foo()
|
|
430
|
-
console.log(
|
|
429
|
+
foo()
|
|
430
|
+
console.log('dead code')
|
|
431
431
|
} else {
|
|
432
|
-
console.log(
|
|
432
|
+
console.log('reachable code')
|
|
433
433
|
}
|
|
434
434
|
```
|
|
435
435
|
|
|
436
436
|
will be transformed to:
|
|
437
437
|
|
|
438
438
|
```js
|
|
439
|
-
console.log(
|
|
439
|
+
console.log('reachable code')
|
|
440
440
|
```
|
|
441
441
|
|
|
442
442
|
- Updated dependencies [8dd6cca]
|
|
@@ -479,18 +479,18 @@
|
|
|
479
479
|
- a30c83d: Add `compat.removeComponentAttrRegex`.
|
|
480
480
|
|
|
481
481
|
```js
|
|
482
|
-
import { pluginReactLynx } from
|
|
483
|
-
import { defineConfig } from
|
|
482
|
+
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
|
|
483
|
+
import { defineConfig } from '@lynx-js/rspeedy'
|
|
484
484
|
|
|
485
485
|
export default defineConfig({
|
|
486
486
|
plugins: [
|
|
487
487
|
pluginReactLynx({
|
|
488
488
|
compat: {
|
|
489
|
-
removeComponentAttrRegex:
|
|
489
|
+
removeComponentAttrRegex: 'YOUR REGEX',
|
|
490
490
|
},
|
|
491
491
|
}),
|
|
492
492
|
],
|
|
493
|
-
})
|
|
493
|
+
})
|
|
494
494
|
```
|
|
495
495
|
|
|
496
496
|
NOTE: This feature is deprecated and will be removed in the future. Use CodeMod instead.
|
|
@@ -509,11 +509,11 @@
|
|
|
509
509
|
|
|
510
510
|
```javascript
|
|
511
511
|
// bar.ts
|
|
512
|
-
import
|
|
512
|
+
import 'background-only'
|
|
513
513
|
|
|
514
514
|
export const bar = () => {
|
|
515
|
-
return
|
|
516
|
-
}
|
|
515
|
+
return 'bar'
|
|
516
|
+
}
|
|
517
517
|
```
|
|
518
518
|
|
|
519
519
|
If `bar` is called in `main-thread`, build time error will be triggered.
|
|
@@ -522,15 +522,15 @@
|
|
|
522
522
|
|
|
523
523
|
```tsx
|
|
524
524
|
// App.tsx
|
|
525
|
-
import { bar } from
|
|
525
|
+
import { bar } from './bar.js'
|
|
526
526
|
|
|
527
527
|
function App() {
|
|
528
|
-
bar()
|
|
528
|
+
bar()
|
|
529
529
|
return (
|
|
530
530
|
<view>
|
|
531
531
|
<text>Hello, Lynx x rspeedy</text>
|
|
532
532
|
</view>
|
|
533
|
-
)
|
|
533
|
+
)
|
|
534
534
|
}
|
|
535
535
|
```
|
|
536
536
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-rsbuild-plugin-canary",
|
|
3
|
-
"version": "0.10.1
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "A rsbuild plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rsbuild",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@lynx-js/css-extract-webpack-plugin": "npm:@lynx-js/css-extract-webpack-plugin-canary@0.5.4",
|
|
36
|
-
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.1
|
|
36
|
+
"@lynx-js/react-alias-rsbuild-plugin": "npm:@lynx-js/react-alias-rsbuild-plugin-canary@0.10.1",
|
|
37
37
|
"@lynx-js/react-refresh-webpack-plugin": "npm:@lynx-js/react-refresh-webpack-plugin-canary@0.3.3",
|
|
38
38
|
"@lynx-js/react-webpack-plugin": "npm:@lynx-js/react-webpack-plugin-canary@0.6.14",
|
|
39
39
|
"@lynx-js/runtime-wrapper-webpack-plugin": "npm:@lynx-js/runtime-wrapper-webpack-plugin-canary@0.1.0",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"typia-rspack-plugin": "2.1.0",
|
|
56
56
|
"@lynx-js/react": "npm:@lynx-js/react-canary@0.109.0",
|
|
57
57
|
"@lynx-js/react-transform": "0.2.0",
|
|
58
|
-
"@lynx-js/
|
|
59
|
-
"@lynx-js/
|
|
58
|
+
"@lynx-js/vitest-setup": "0.0.0",
|
|
59
|
+
"@lynx-js/rspeedy": "npm:@lynx-js/rspeedy-canary@0.9.7"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@lynx-js/react": "*"
|