@taro-hmr-compile/preset 0.0.1-alpha.5 → 0.0.1-alpha.7

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/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- declare const _default: () => {
2
- plugins: string[];
1
+ import type { WebpackHmrCompileOpt } from '@taro-hmr-compile/plugin-webpack';
2
+ export type TaroHmrCompilePresetOptions = Partial<WebpackHmrCompileOpt>;
3
+ declare const _default: (_ctx: unknown, options?: TaroHmrCompilePresetOptions) => {
4
+ plugins: (string | (string | Partial<WebpackHmrCompileOpt>)[])[];
3
5
  };
4
6
  export default _default;
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = () => {
3
+ exports.default = (_ctx, options = {}) => {
4
4
  const plugins = [
5
- require.resolve('@taro-hmr-compile/plugin-webpack')
5
+ require.resolve('@taro-hmr-compile/react-refresh/compiler'),
6
+ [require.resolve('@taro-hmr-compile/plugin-webpack'), options],
6
7
  ];
7
8
  return { plugins };
8
9
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,kBAAe,GAAG,EAAE;IAChB,MAAM,OAAO,GAAG;QACZ,OAAO,CAAC,OAAO,CAAC,kCAAkC,CAAC;KACtD,CAAA;IACD,OAAO,EAAC,OAAO,EAAC,CAAA;AACpB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAKA,kBAAe,CAAC,IAAa,EAAE,UAAuC,EAAE,EAAE,EAAE;IACxE,MAAM,OAAO,GAAG;QACZ,OAAO,CAAC,OAAO,CAAC,0CAA0C,CAAC;QAC3D,CAAC,OAAO,CAAC,OAAO,CAAC,kCAAkC,CAAC,EAAE,OAAO,CAAC;KACjE,CAAA;IACD,OAAO,EAAC,OAAO,EAAC,CAAA;AACpB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taro-hmr-compile/preset",
3
- "version": "0.0.1-alpha.5",
3
+ "version": "0.0.1-alpha.7",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,7 +23,8 @@
23
23
  "typescript": "^5.8.2"
24
24
  },
25
25
  "dependencies": {
26
- "@taro-hmr-compile/plugin-webpack": "0.0.1-alpha.5"
26
+ "@taro-hmr-compile/plugin-webpack": "0.0.1-alpha.7",
27
+ "@taro-hmr-compile/react-refresh": "0.0.1-alpha.7"
27
28
  },
28
29
  "scripts": {
29
30
  "build": "tsc"
package/src/index.ts CHANGED
@@ -1,6 +1,12 @@
1
- export default () => {
1
+
2
+ import type {WebpackHmrCompileOpt} from '@taro-hmr-compile/plugin-webpack'
3
+
4
+ export type TaroHmrCompilePresetOptions = Partial<WebpackHmrCompileOpt>
5
+
6
+ export default (_ctx: unknown, options: TaroHmrCompilePresetOptions = {}) => {
2
7
  const plugins = [
3
- require.resolve('@taro-hmr-compile/plugin-webpack')
8
+ require.resolve('@taro-hmr-compile/react-refresh/compiler'),
9
+ [require.resolve('@taro-hmr-compile/plugin-webpack'), options],
4
10
  ]
5
11
  return {plugins}
6
12
  }