@vitejs/plugin-react-swc 4.2.0 → 4.2.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 (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -80,7 +80,7 @@ const silenceUseClientWarning = (userConfig) => ({ rollupOptions: { onwarn(warni
80
80
  //#region src/index.ts
81
81
  const resolve = createRequire(import.meta.url).resolve;
82
82
  const react = (_options) => {
83
- let hmrDisabled = false;
83
+ let hmrDisabled = true;
84
84
  let viteCacheRoot;
85
85
  const options = {
86
86
  jsxImportSource: _options?.jsxImportSource ?? "react",
@@ -114,12 +114,12 @@ const react = (_options) => {
114
114
  oxc: false,
115
115
  optimizeDeps: {
116
116
  include: [`${options.jsxImportSource}/jsx-dev-runtime`],
117
- ..."rolldownVersion" in vite ? { rollupOptions: { transform: { jsx: { runtime: "automatic" } } } } : { esbuildOptions: { jsx: "automatic" } }
117
+ ..."rolldownVersion" in vite ? { rolldownOptions: { transform: { jsx: { runtime: "automatic" } } } } : { esbuildOptions: { jsx: "automatic" } }
118
118
  }
119
119
  }),
120
120
  configResolved(config) {
121
121
  viteCacheRoot = config.cacheDir;
122
- if (config.server.hmr === false) hmrDisabled = true;
122
+ hmrDisabled = config.server.hmr === false;
123
123
  const mdxIndex = config.plugins.findIndex((p) => p.name === "@mdx-js/rollup");
124
124
  if (mdxIndex !== -1 && mdxIndex > config.plugins.findIndex((p) => p.name === "vite:react-swc")) throw new Error("[vite:react-swc] The MDX plugin should be placed before this plugin");
125
125
  if ("rolldownVersion" in vite && !options.plugins && !options.useAtYourOwnRisk_mutateSwcOptions && !options.disableOxcRecommendation) config.logger.warn("[vite:react-swc] We recommend switching to `@vitejs/plugin-react` for improved performance as no swc plugins are used. More information at https://vite.dev/rolldown");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-react-swc",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "license": "MIT",
5
5
  "author": "Arnaud Barré (https://github.com/ArnaudBarre)",
6
6
  "description": "Speed up your Vite dev server with SWC",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react-swc#readme",
28
28
  "dependencies": {
29
- "@rolldown/pluginutils": "1.0.0-beta.43",
29
+ "@rolldown/pluginutils": "1.0.0-beta.47",
30
30
  "@swc/core": "^1.13.5"
31
31
  },
32
32
  "peerDependencies": {