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

There is a small correction in the vite installation docs : I have provided some updates #157

Open
PratikVR opened this issue Dec 20, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@PratikVR
Copy link

PratikVR commented Dec 20, 2024

I recently tired to install your cli for my vite-solidjs project and i was having style and import alias issues however i have got very less time to actually clone your repo and update and create a pull request so i'll leave the solution in this issue itself 😊

for any vite project your alias should be configured like the following :

vite.config.js

take the following config for ref.

import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';

export default defineConfig({
  plugins: [solidPlugin()],
  server: {
    port: 3000,
  },
  resolve: {
    alias: {
      "~": "/src" 
       /** this is the correction as vite doesn't allow you to use the __dirname directly 
       *    and tells you mention the absolute   path to the source dir */
    }
  },
  build: {
    target: 'esnext',
  },
});

one more thing to take care of :
in your

tailwind.config.js

make sure to do this as your files will be of type js, jsx also which was not by default

content: ["./src/**/*.{js,jsx,ts,tsx}"], 
/** add "node_modules/**/*" in the list    if the style doen't take an effect 
*    i had to do that in my case it was later automatically removed */
@PratikVR PratikVR changed the title There is a small correction There is a small correction in the vite installation docs : I have provided some updates Dec 20, 2024
@stefan-karger stefan-karger added the documentation Improvements or additions to documentation label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants