@lynx-js/react-webpack-plugin 0.6.15 → 0.6.16
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 +12 -0
- package/lib/ReactWebpackPlugin.js +4 -3
- package/lib/loaders/options.js +6 -4
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @lynx-js/react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.6.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Supports `@lynx-js/template-webpack-plugin` 0.8.0. ([#1033](https://github.com/lynx-family/lynx-stack/pull/1033))
|
|
8
|
+
|
|
9
|
+
- Support `@lynx-js/react` v0.110.0. ([#770](https://github.com/lynx-family/lynx-stack/pull/770))
|
|
10
|
+
|
|
11
|
+
- Keep snapshot id unchanged on Windows. ([#1050](https://github.com/lynx-family/lynx-stack/pull/1050))
|
|
12
|
+
|
|
13
|
+
- Fix lazy bundle name on Windows. ([#1060](https://github.com/lynx-family/lynx-stack/pull/1060))
|
|
14
|
+
|
|
3
15
|
## 0.6.15
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -159,6 +159,7 @@ class ReactWebpackPlugin {
|
|
|
159
159
|
const runtimeFile = require.resolve(path);
|
|
160
160
|
lepusCode.chunks.push({
|
|
161
161
|
name: 'worklet-runtime',
|
|
162
|
+
// @ts-expect-error Rspack x Webpack sources not match
|
|
162
163
|
source: new RawSource(fs.readFileSync(runtimeFile, 'utf8')),
|
|
163
164
|
info: {
|
|
164
165
|
['lynx:main-thread']: true,
|
|
@@ -187,11 +188,11 @@ class ReactWebpackPlugin {
|
|
|
187
188
|
})`));
|
|
188
189
|
return args;
|
|
189
190
|
});
|
|
190
|
-
// The react-transform will add
|
|
191
|
+
// The react-transform will add `-react__${LAYER}` to the webpackChunkName.
|
|
191
192
|
// We replace it with an empty string here to make sure main-thread & background chunk match.
|
|
192
193
|
hooks.asyncChunkName.tap(this.constructor.name, (chunkName) => chunkName
|
|
193
|
-
?.replaceAll(
|
|
194
|
-
?.replaceAll(
|
|
194
|
+
?.replaceAll(`-react__background`, '')
|
|
195
|
+
?.replaceAll(`-react__main-thread`, ''));
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
198
|
#updateMainThreadInfo(compilation, name) {
|
package/lib/loaders/options.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { LAYERS } from '../layer.js';
|
|
6
5
|
const PLUGIN_NAME = 'react:webpack';
|
|
7
6
|
const JSX_IMPORT_SOURCE = {
|
|
8
7
|
MAIN_THREAD: '@lynx-js/react/lepus',
|
|
@@ -12,8 +11,11 @@ const PUBLIC_RUNTIME_PKG = '@lynx-js/react';
|
|
|
12
11
|
const RUNTIME_PKG = '@lynx-js/react/internal';
|
|
13
12
|
const OLD_RUNTIME_PKG = '@lynx-js/react-runtime';
|
|
14
13
|
const COMPONENT_PKG = '@lynx-js/react-components';
|
|
14
|
+
function normalizeSlashes(file) {
|
|
15
|
+
return file.replaceAll(path.win32.sep, '/');
|
|
16
|
+
}
|
|
15
17
|
function getCommonOptions() {
|
|
16
|
-
const filename = path.relative(this.rootContext, this.resourcePath);
|
|
18
|
+
const filename = normalizeSlashes(path.relative(this.rootContext, this.resourcePath));
|
|
17
19
|
const { compat, enableRemoveCSSScope, inlineSourcesContent, isDynamicComponent, defineDCE = { define: {} }, } = this.getOptions();
|
|
18
20
|
const syntax = (/\.[mc]?tsx?$/.exec(this.resourcePath))
|
|
19
21
|
? 'typescript'
|
|
@@ -109,7 +111,7 @@ export function getMainThreadTransformOptions() {
|
|
|
109
111
|
target: 'LEPUS',
|
|
110
112
|
},
|
|
111
113
|
dynamicImport: {
|
|
112
|
-
layer:
|
|
114
|
+
layer: `react__main-thread`,
|
|
113
115
|
runtimePkg: RUNTIME_PKG,
|
|
114
116
|
},
|
|
115
117
|
defineDCE: {
|
|
@@ -179,7 +181,7 @@ export function getBackgroundTransformOptions() {
|
|
|
179
181
|
}
|
|
180
182
|
: false,
|
|
181
183
|
dynamicImport: {
|
|
182
|
-
layer:
|
|
184
|
+
layer: `react__background`,
|
|
183
185
|
runtimePkg: RUNTIME_PKG,
|
|
184
186
|
},
|
|
185
187
|
snapshot: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/react-webpack-plugin",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.16",
|
|
4
4
|
"description": "A webpack plugin for ReactLynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@microsoft/api-extractor": "7.52.8",
|
|
41
|
-
"@rspack/core": "1.3.
|
|
41
|
+
"@rspack/core": "1.3.15",
|
|
42
42
|
"css-loader": "^7.1.2",
|
|
43
43
|
"swc-loader": "^0.2.6",
|
|
44
44
|
"webpack": "^5.99.9",
|
|
45
|
-
"@lynx-js/css-extract-webpack-plugin": "0.
|
|
46
|
-
"@lynx-js/react": "0.
|
|
47
|
-
"@lynx-js/template-webpack-plugin": "0.
|
|
45
|
+
"@lynx-js/css-extract-webpack-plugin": "0.6.0",
|
|
46
|
+
"@lynx-js/react": "0.110.0",
|
|
47
|
+
"@lynx-js/template-webpack-plugin": "0.8.0",
|
|
48
48
|
"@lynx-js/test-tools": "0.0.0",
|
|
49
49
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0",
|
|
53
|
-
"@lynx-js/template-webpack-plugin": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0"
|
|
52
|
+
"@lynx-js/react": "^0.103.0 || ^0.104.0 || ^0.105.0 || ^0.106.0 || ^0.107.0 || ^0.108.0 || ^0.109.0 || ^0.110.0",
|
|
53
|
+
"@lynx-js/template-webpack-plugin": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
56
56
|
"@lynx-js/react": {
|