-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use this with Vite? #5
Comments
@FezVrasta Vite uses different plugin API than Esbuild, so this plugin wouldn't work there. yarn add --dev 'https://gitpkg.now.sh/lukalabs/lukalabs-npm/packages/esbuild-styled-components?vite-plugin' Here's how you would use it in import styledComponentsPlugin from '@lukalabs/esbuild-styled-components/vite';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [styledComponentsPlugin({ namespace: 'xxx' }), react()],
}) |
Thanks, I get this error when I try your command, may you publish it on npm please? Internal Error: Invalid descriptor (https://gitpkg.now.sh/lukalabs/lukalabs-npm/packages/esbuild-styled-components?vite-plugin) |
Are you using Yarn 2? yarn add --dev '@lukalabs/esbuild-styled-components@https://gitpkg.now.sh/api/pkg.tgz?url=lukalabs%2Flukalabs-npm%2Fpackages%2Fesbuild-styled-components&commit=vite-plugin' |
Thanks, this installs correctly with Yarn 2, but the plugin doesn't seem to do anything, my |
Yes, the implementation here is limited and doesn't include Have you tried using |
I'm using the react-plugin-swc with the swc styled-components plugin for now, having a esbuild-native solution would have been great though! |
@FezVrasta are you using awc plugin setup with Vite? If yes, then do you have sample repo for it? |
I'm just using this in the plugins list:
|
Thanks for the plugin! I tried to use the styled-components plugin on a Vite project but it doesn't seem to do anything, I tried to use it in the
optimizeDeps.esbuildOptions.plugins
and in theplugins
but it has no effect. Could you provide guidance please?The text was updated successfully, but these errors were encountered: