@vitejs/plugin-react-swc 3.4.0 → 3.5.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.
Files changed (3) hide show
  1. package/index.cjs +3 -2
  2. package/index.mjs +3 -2
  3. package/package.json +3 -3
package/index.cjs CHANGED
@@ -40,7 +40,8 @@ var react = (_options) => {
40
40
  config: () => ({
41
41
  esbuild: false,
42
42
  optimizeDeps: {
43
- include: [`${options.jsxImportSource}/jsx-dev-runtime`]
43
+ include: [`${options.jsxImportSource}/jsx-dev-runtime`],
44
+ esbuildOptions: { jsx: "automatic" }
44
45
  }
45
46
  }),
46
47
  configResolved(config) {
@@ -146,7 +147,7 @@ RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => {
146
147
  };
147
148
  var transformWithOptions = async (id, code, target, options, reactConfig) => {
148
149
  const decorators = (options == null ? void 0 : options.tsDecorators) ?? false;
149
- const parser = id.endsWith(".tsx") ? { syntax: "typescript", tsx: true, decorators } : id.endsWith(".ts") ? { syntax: "typescript", tsx: false, decorators } : id.endsWith(".jsx") ? { syntax: "ecmascript", jsx: true } : id.endsWith(".mdx") ? (
150
+ const parser = id.endsWith(".tsx") ? { syntax: "typescript", tsx: true, decorators } : id.endsWith(".ts") || id.endsWith(".mts") ? { syntax: "typescript", tsx: false, decorators } : id.endsWith(".jsx") ? { syntax: "ecmascript", jsx: true } : id.endsWith(".mdx") ? (
150
151
  // JSX is required to trigger fast refresh transformations, even if MDX already transforms it
151
152
  { syntax: "ecmascript", jsx: true }
152
153
  ) : void 0;
package/index.mjs CHANGED
@@ -41,7 +41,8 @@ var react = (_options) => {
41
41
  config: () => ({
42
42
  esbuild: false,
43
43
  optimizeDeps: {
44
- include: [`${options.jsxImportSource}/jsx-dev-runtime`]
44
+ include: [`${options.jsxImportSource}/jsx-dev-runtime`],
45
+ esbuildOptions: { jsx: "automatic" }
45
46
  }
46
47
  }),
47
48
  configResolved(config) {
@@ -147,7 +148,7 @@ RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => {
147
148
  };
148
149
  var transformWithOptions = async (id, code, target, options, reactConfig) => {
149
150
  const decorators = (options == null ? void 0 : options.tsDecorators) ?? false;
150
- const parser = id.endsWith(".tsx") ? { syntax: "typescript", tsx: true, decorators } : id.endsWith(".ts") ? { syntax: "typescript", tsx: false, decorators } : id.endsWith(".jsx") ? { syntax: "ecmascript", jsx: true } : id.endsWith(".mdx") ? (
151
+ const parser = id.endsWith(".tsx") ? { syntax: "typescript", tsx: true, decorators } : id.endsWith(".ts") || id.endsWith(".mts") ? { syntax: "typescript", tsx: false, decorators } : id.endsWith(".jsx") ? { syntax: "ecmascript", jsx: true } : id.endsWith(".mdx") ? (
151
152
  // JSX is required to trigger fast refresh transformations, even if MDX already transforms it
152
153
  { syntax: "ecmascript", jsx: true }
153
154
  ) : void 0;
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.4.0",
4
+ "version": "3.5.0",
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"
28
+ "vite": "^4 || ^5"
29
29
  },
30
30
  "dependencies": {
31
- "@swc/core": "^1.3.85"
31
+ "@swc/core": "^1.3.96"
32
32
  }
33
33
  }