How to run vite server if index.html file is not in the root directory

Viewed 2822

enter image description here

  • Index.html & app.css is outside of the /tailwindcss/...
  • Vite Server is running but not working on localhost.

How to fix this problem

I don't want to put index.html in directory tailwindcss.

1 Answers

You could try specifying the entry point used by Rollup explicitly:

// vite.config.ts
export default {
  build: {
    rollupOptions: {
      input: {
        // entry point for compilation; normally would be "./index.html"
        app: '../index.html',

but honestly it feels like you're fighting against the tools, and you should have that package.json one directory up in your project.

Related