Last active
January 25, 2024 05:57
-
-
Save unyo/f73ab5f9344b3948260b8d5e40ffbd42 to your computer and use it in GitHub Desktop.
Vite + SWC + styled-components displayName
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
npm create vite@latest # choose template react, js + swc | |
npm i --save-dev @vitejs/plugin-legacy terser @vitejs/plugin-react-swc @swc/[email protected] # downgrade @swc/plugin-styled-components to 1.5.111 https://github.com/vitejs/vite-plugin-react-swc/issues/190#issuecomment-1907977402 | |
npm i --save styled-components | |
# edit vite.config.js: | |
cat <<EOF > vite.config.js | |
import { defineConfig } from 'vite' | |
import react from '@vitejs/plugin-react-swc' | |
import legacy from '@vitejs/plugin-legacy' | |
export default defineConfig({ | |
plugins: [ | |
react({ plugins: [["@swc/plugin-styled-components", {}]] }), | |
legacy(), | |
], | |
}) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment