Skip to content
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

Vite + Styled Components Example #375

Open
seanmcquaid opened this issue Nov 2, 2023 · 4 comments
Open

Vite + Styled Components Example #375

seanmcquaid opened this issue Nov 2, 2023 · 4 comments

Comments

@seanmcquaid
Copy link

seanmcquaid commented Nov 2, 2023

More of a request but is there any chance we can get an ideal example for using Styled Components with Vite? I tried my hand at it but would love to see something here to go off of.

@seanmcquaid
Copy link
Author

Update on this, might have a working example that follows some previous code ya'll added! Going to try and contribute an example for this when I get some time

@Amadeo-Frontend
Copy link

this one works for me
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
include: /.(jsx|tsx)$/,
babel: {
plugins: ['styled-components'],
babelrc: false,
configFile: false,
},
}),
],
});

@SilencerWeb
Copy link

@seanmcquaid hey, have you figured out how to make Remix + Vite work with styled-components?

@seanmcquaid
Copy link
Author

I did! Here are the links to the entry.server.tsx + root.tsx files, it was really just following what was already in place.

https://github.com/seanmcquaid/remix-unstable-vite-playground/blob/main/app/entry.server.tsx#L38-L55

https://github.com/seanmcquaid/remix-unstable-vite-playground/blob/main/app/root.tsx#L37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants