@vitejs/plugin-react-swc 3.3.1 → 3.3.2

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.
Files changed (3) hide show
  1. package/index.cjs +3 -2
  2. package/index.mjs +3 -2
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -61,15 +61,16 @@ var react = (_options) => {
61
61
  ],
62
62
  async transform(code, _id, transformOptions) {
63
63
  const id = _id.split("?")[0];
64
+ const refresh = !(transformOptions == null ? void 0 : transformOptions.ssr) && !process.env.TEST;
64
65
  const result = await transformWithOptions(id, code, "es2020", options, {
65
- refresh: !(transformOptions == null ? void 0 : transformOptions.ssr),
66
+ refresh,
66
67
  development: true,
67
68
  runtime: "automatic",
68
69
  importSource: options.jsxImportSource
69
70
  });
70
71
  if (!result)
71
72
  return;
72
- if ((transformOptions == null ? void 0 : transformOptions.ssr) || !refreshContentRE.test(result.code)) {
73
+ if (!refresh || !refreshContentRE.test(result.code)) {
73
74
  return result;
74
75
  }
75
76
  result.code = `import * as RefreshRuntime from "${runtimePublicPath}";
package/index.mjs CHANGED
@@ -62,15 +62,16 @@ var react = (_options) => {
62
62
  ],
63
63
  async transform(code, _id, transformOptions) {
64
64
  const id = _id.split("?")[0];
65
+ const refresh = !(transformOptions == null ? void 0 : transformOptions.ssr) && !process.env.TEST;
65
66
  const result = await transformWithOptions(id, code, "es2020", options, {
66
- refresh: !(transformOptions == null ? void 0 : transformOptions.ssr),
67
+ refresh,
67
68
  development: true,
68
69
  runtime: "automatic",
69
70
  importSource: options.jsxImportSource
70
71
  });
71
72
  if (!result)
72
73
  return;
73
- if ((transformOptions == null ? void 0 : transformOptions.ssr) || !refreshContentRE.test(result.code)) {
74
+ if (!refresh || !refreshContentRE.test(result.code)) {
74
75
  return result;
75
76
  }
76
77
  result.code = `import * as RefreshRuntime from "${runtimePublicPath}";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-react-swc",
3
3
  "description": "Speed up your Vite dev server with SWC",
4
- "version": "3.3.1",
4
+ "version": "3.3.2",
5
5
  "author": "Arnaud Barré (https://github.com/ArnaudBarre)",
6
6
  "license": "MIT",
7
7
  "repository": "github:vitejs/vite-plugin-react-swc",
@@ -28,6 +28,6 @@
28
28
  "vite": "^4"
29
29
  },
30
30
  "dependencies": {
31
- "@swc/core": "^1.3.56"
31
+ "@swc/core": "^1.3.61"
32
32
  }
33
33
  }