@octanejs/rsbuild-plugin 0.1.37 → 0.1.39
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/README.md +11 -1
- package/package.json +5 -5
- package/src/index.js +4 -0
- package/types/index.d.ts +7 -0
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ includes Samsung Internet 14, which corresponds to Chromium 87. ES levels and
|
|
|
75
75
|
browser targets cannot be mixed in the same array. Transpilation changes syntax;
|
|
76
76
|
applications remain responsible for any additional Web API polyfills they use.
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Common compiler options:
|
|
79
79
|
|
|
80
80
|
- `hmr` controls browser component handoff;
|
|
81
81
|
- `parallel` controls compiler workers; the default uses up to four, `false`
|
|
@@ -89,6 +89,16 @@ Rspack shares one loader worker pool per process, so the first parallel loader
|
|
|
89
89
|
determines its effective size. Worker startup has a fixed cost, so very small
|
|
90
90
|
builds may be faster with `parallel: false`.
|
|
91
91
|
|
|
92
|
+
The experimental `cssModuleConstants` option forwards the Rspack class plugin's
|
|
93
|
+
immutable CSS-export contract to both build environments. Use
|
|
94
|
+
`pluginOctane({ cssModuleConstants: true })` with
|
|
95
|
+
`output.cssModules.namedExport: true` and named or namespace CSS imports to fold
|
|
96
|
+
proven strings from Rsbuild's CSS-loader pipeline. Mutable default maps require
|
|
97
|
+
an explicit immutable-provider callback. This is disabled by default, adds a
|
|
98
|
+
bounded extra compile for eligible consumers, and leaves native `css/module`,
|
|
99
|
+
development, HMR, and watch output unchanged. See
|
|
100
|
+
[CSS-module constants](../../docs/compiler-css-module-constants.md).
|
|
101
|
+
|
|
92
102
|
Enable Strong mode for the whole app in `octane.config.ts`:
|
|
93
103
|
|
|
94
104
|
```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/rsbuild-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@octanejs/app-core": "0.0.
|
|
52
|
-
"@octanejs/rspack-plugin": "0.1.
|
|
51
|
+
"@octanejs/app-core": "0.0.40",
|
|
52
|
+
"@octanejs/rspack-plugin": "0.1.39"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@rsbuild/core": "^2.0.0",
|
|
56
|
-
"octane": "0.1.
|
|
56
|
+
"octane": "0.1.44"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@rsbuild/core": "^2.1.6",
|
|
@@ -63,6 +63,6 @@
|
|
|
63
63
|
"playwright": "^1.61.1",
|
|
64
64
|
"type-fest": "^5.8.0",
|
|
65
65
|
"vitest": "^4.1.10",
|
|
66
|
-
"octane": "0.1.
|
|
66
|
+
"octane": "0.1.44"
|
|
67
67
|
}
|
|
68
68
|
}
|
package/src/index.js
CHANGED
|
@@ -234,6 +234,7 @@ function assertRootPublicPaths(config, clientEnvironment) {
|
|
|
234
234
|
* @param {{
|
|
235
235
|
* hmr?: boolean,
|
|
236
236
|
* parallel?: boolean | { maxWorkers?: number },
|
|
237
|
+
* cssModuleConstants?: import('@octanejs/rspack-plugin').OctaneRspackPluginOptions['cssModuleConstants'],
|
|
237
238
|
* profile?: boolean,
|
|
238
239
|
* strong?: boolean,
|
|
239
240
|
* exclude?: string[],
|
|
@@ -548,6 +549,9 @@ export function pluginOctane(inlineOptions = {}) {
|
|
|
548
549
|
environment,
|
|
549
550
|
transpile: false,
|
|
550
551
|
...(inlineOptions.parallel === undefined ? null : { parallel: inlineOptions.parallel }),
|
|
552
|
+
...(inlineOptions.cssModuleConstants === undefined
|
|
553
|
+
? null
|
|
554
|
+
: { cssModuleConstants: inlineOptions.cssModuleConstants }),
|
|
551
555
|
...(strong === undefined ? null : { strong }),
|
|
552
556
|
...(inlineOptions.hmr === undefined ? null : { hmr: inlineOptions.hmr }),
|
|
553
557
|
...(inlineOptions.profile === undefined
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
+
import type { OctaneRspackPluginOptions } from '@octanejs/rspack-plugin';
|
|
2
3
|
|
|
3
4
|
export * from '@octanejs/app-core';
|
|
4
5
|
export {
|
|
@@ -9,6 +10,12 @@ export {
|
|
|
9
10
|
} from '@octanejs/app-core/config-loader';
|
|
10
11
|
|
|
11
12
|
export interface OctaneRsbuildPluginOptions {
|
|
13
|
+
/**
|
|
14
|
+
* @experimental Fold authenticated JavaScript CSS-module exports in one-shot
|
|
15
|
+
* production builds. Uses the Rspack plugin's exact-source provider contract;
|
|
16
|
+
* native `css/module` remains unchanged. Disabled by default.
|
|
17
|
+
*/
|
|
18
|
+
cssModuleConstants?: OctaneRspackPluginOptions['cssModuleConstants'];
|
|
12
19
|
/** Override component HMR in the browser environment. */
|
|
13
20
|
hmr?: boolean;
|
|
14
21
|
/**
|