Speed up your Vite dev server with SWC
MIT License
Bot releases are visible (Hide)
This will unlock to use the plugin in some use cases where the original source code is not in TS. Using this option to keep using JSX inside .js
files is highly discouraged and can be removed in any future version.
Published by github-actions[bot] 11 months ago
There were no breaking change that impacted this plugin, so any combination of React plugins and Vite core version will work.
This will only affect people using internal libraries that contains untranspiled JSX. This change aligns the optimizer with the source code and avoid issues when the published source don't have React
in the scope.
Reminder: While being partially supported in Vite, publishing TS & JSX outside of internal libraries is highly discouraged.
Published by github-actions[bot] 12 months ago
.mts
(fixes #161)Using CJS in source code will not work in Vite (and will never be supported), so this is better to only use .ts
.
But to better align with Vite core defaults, .mts
extension will now be processed like .ts
. This maybe reverted in a future major.
Published by github-actions[bot] about 1 year ago
Published by ArnaudBarre over 1 year ago
Published by ArnaudBarre over 1 year ago
type: module
to package.json (#101). Because the library already publish .cjs
& .mjs
files, the only change is for typing when using the node16 module resolution (fixes #95)3.2.0
and this should people that were using both plugins before this version to migrate.Published by github-actions[bot] over 1 year ago
"use client"
warning when building library like @tanstack/react-query
This release goes in hand with the upcoming Vite 4.3 release focusing on performances:
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
plugins
optionstsDecorators
option. This requires experimentalDecorators
in tsconfig.Published by github-actions[bot] almost 2 years ago
tsDecorators
option. This requires experimentalDecorators
in tsconfig.plugins
optionsPublished by ArnaudBarre almost 2 years ago
This is plugin is now stable! π
To migrate from vite-plugin-swc-react-refresh
, see the 3.0.0-beta.0 changelog.
Published by ArnaudBarre almost 2 years ago
Published by ArnaudBarre almost 2 years ago
Fix package.json exports fields
Published by ArnaudBarre almost 2 years ago
This is the first beta version of the official plugin for using SWC with React in Vite!
Some breaking changes have been made to make the plugin closer to the Babel one while keeping the smallest API surface possible to reduce bugs, encourage future-proof compilation output and allow easier opt-in into future perf improvements (caching, move to other native toolchain, ...):
.js
filesesbuild.define
config option to SWC. You can use the top level define option insteadTo migrate, change your config to:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
export default defineConfig({
plugins: [react()],
});
This new release also include a runtime check for React refresh boundaries. When the conditions are not met (most of the time, exporting React components alongside functions or constant), the module is invalidated with a warning message to help you catch issues while keeping you page up-to date with code changes.
Published by github-actions[bot] almost 2 years ago
.jsx
imports. Relying on file extension for this is more buggy than I though
react-refresh
-> swc-react-refresh
)Published by github-actions[bot] almost 2 years ago
Add source maps support
Published by github-actions[bot] about 2 years ago
Include react/jsx-dev-runtime
for dependencies optimisation when using automatic runtime.
Published by github-actions[bot] about 2 years ago
Unpinned @swc/core
to get new features (like TS instantiation expression) despite a 30mb bump of bundle size