@lynx-js/react-webpack-plugin 0.6.20 → 0.7.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @lynx-js/react-webpack-plugin
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Remove `@lynx-js/react` from peerDependencies. ([#1711](https://github.com/lynx-family/lynx-stack/pull/1711))
8
+
9
+ - Add a new required option `workletRuntimePath`. ([#1711](https://github.com/lynx-family/lynx-stack/pull/1711))
10
+
3
11
  ## 0.6.20
4
12
 
5
13
  ### Patch Changes
@@ -42,6 +42,10 @@ interface ReactWebpackPluginOptions {
42
42
  * @defaultValue `false` when production, `true` when development
43
43
  */
44
44
  profile?: boolean | undefined;
45
+ /**
46
+ * The file path of `@lynx-js/react/worklet-runtime`.
47
+ */
48
+ workletRuntimePath: string;
45
49
  }
46
50
  /**
47
51
  * ReactWebpackPlugin allows using ReactLynx with webpack
@@ -78,6 +78,7 @@ class ReactWebpackPlugin {
78
78
  extractStr: false,
79
79
  experimental_isLazyBundle: false,
80
80
  profile: undefined,
81
+ workletRuntimePath: '',
81
82
  }); }
82
83
  /**
83
84
  * The entry point of a webpack plugin.
@@ -155,13 +156,9 @@ class ReactWebpackPlugin {
155
156
  hooks.beforeEncode.tap(this.constructor.name, (args) => {
156
157
  const lepusCode = args.encodeData.lepusCode;
157
158
  if (lepusCode.root?.source.source().toString()?.includes('registerWorkletInternal')) {
158
- const path = compiler.options.mode === 'development'
159
- ? '@lynx-js/react/worklet-dev-runtime'
160
- : '@lynx-js/react/worklet-runtime';
161
- const runtimeFile = require.resolve(path);
162
159
  lepusCode.chunks.push({
163
160
  name: 'worklet-runtime',
164
- source: new RawSource(fs.readFileSync(runtimeFile, 'utf8')),
161
+ source: new RawSource(fs.readFileSync(options.workletRuntimePath, 'utf8')),
165
162
  info: {
166
163
  ['lynx:main-thread']: true,
167
164
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/react-webpack-plugin",
3
- "version": "0.6.20",
3
+ "version": "0.7.0",
4
4
  "description": "A webpack plugin for ReactLynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -38,18 +38,17 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@microsoft/api-extractor": "7.52.11",
41
- "@rspack/core": "1.4.11",
41
+ "@rspack/core": "1.5.2",
42
42
  "css-loader": "^7.1.2",
43
43
  "swc-loader": "^0.2.6",
44
44
  "webpack": "^5.101.3",
45
45
  "@lynx-js/css-extract-webpack-plugin": "0.6.2",
46
- "@lynx-js/react": "0.112.4",
47
- "@lynx-js/template-webpack-plugin": "0.8.5",
46
+ "@lynx-js/react": "0.113.0",
47
+ "@lynx-js/template-webpack-plugin": "0.8.6",
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 || ^0.110.0 || ^0.111.0 || ^0.112.0",
53
52
  "@lynx-js/template-webpack-plugin": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0"
54
53
  },
55
54
  "peerDependenciesMeta": {