@vitejs/plugin-react-swc 3.7.0 → 3.7.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.
package/README.md CHANGED
@@ -30,7 +30,7 @@ This plugin has limited options to enable good performances and be transpiler ag
30
30
  - `jsx runtime` is always `automatic`
31
31
  - In development:
32
32
  - esbuild is disabled, so the [esbuild configuration](https://vitejs.dev/config/shared-options.html#esbuild) has no effect
33
- - `target` is `es2020`
33
+ - `target` is ignored and defaults to `es2020` (see [`devTarget`](#devtarget))
34
34
  - JS files are not transformed
35
35
  - tsconfig is not resolved, so properties other than the ones listed above behaves like TS defaults
36
36
 
package/index.cjs CHANGED
@@ -196,6 +196,9 @@ var silenceUseClientWarning = (userConfig) => ({
196
196
  if (warning.code === "MODULE_LEVEL_DIRECTIVE" && warning.message.includes("use client")) {
197
197
  return;
198
198
  }
199
+ if (warning.code === "SOURCEMAP_ERROR" && warning.message.includes("resolve original location") && warning.pos === 0) {
200
+ return;
201
+ }
199
202
  if ((_b2 = (_a2 = userConfig.build) == null ? void 0 : _a2.rollupOptions) == null ? void 0 : _b2.onwarn) {
200
203
  userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
201
204
  } else {
package/index.mjs CHANGED
@@ -197,6 +197,9 @@ var silenceUseClientWarning = (userConfig) => ({
197
197
  if (warning.code === "MODULE_LEVEL_DIRECTIVE" && warning.message.includes("use client")) {
198
198
  return;
199
199
  }
200
+ if (warning.code === "SOURCEMAP_ERROR" && warning.message.includes("resolve original location") && warning.pos === 0) {
201
+ return;
202
+ }
200
203
  if ((_b2 = (_a2 = userConfig.build) == null ? void 0 : _a2.rollupOptions) == null ? void 0 : _b2.onwarn) {
201
204
  userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
202
205
  } else {
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.7.0",
4
+ "version": "3.7.2",
5
5
  "author": "Arnaud Barré (https://github.com/ArnaudBarre)",
6
6
  "license": "MIT",
7
7
  "repository": "github:vitejs/vite-plugin-react-swc",
@@ -25,9 +25,9 @@
25
25
  "fast refresh"
26
26
  ],
27
27
  "peerDependencies": {
28
- "vite": "^4 || ^5"
28
+ "vite": "^4 || ^5 || ^6"
29
29
  },
30
30
  "dependencies": {
31
- "@swc/core": "^1.5.7"
31
+ "@swc/core": "^1.7.26"
32
32
  }
33
33
  }
@@ -364,11 +364,6 @@ function isLikelyComponentType(type) {
364
364
  }
365
365
  }
366
366
  }
367
- if (window.$RefreshReg$) {
368
- throw new Error(
369
- "React refresh runtime was loaded twice. Maybe you forgot the base path?"
370
- );
371
- }
372
367
  function getRefreshReg(filename) {
373
368
  return (type, id) => register(type, filename + " " + id);
374
369
  }