Mike
Mike

Reputation: 83

How do i add vite.config.js file to my project?

I added vite to my project to run TailwindCSS. And now I am done and I wanted to build the project. But it only builds my index.html, not all my other pages (just using vanilla html and js). I know the line "npx tailwindcss init -p" to add the tailwind.config.js. Is there a command like this for Vite so i can say to build ./*.html?

 {
  "name": "tirisi",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "serve": "npm run build && vite preview"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "autoprefixer": "^10.4.2",
    "postcss": "^8.4.8",
    "tailwindcss": "^3.0.23",
    "vite": "^2.8.6"
  },
  "dependencies": {
    "@tailwindcss/line-clamp": "^0.3.1",
    "daisyui": "^2.11.1"
  }
}

Upvotes: 2

Views: 12006

Answers (1)

tbjgolden
tbjgolden

Reputation: 1325

From https://vitejs.dev/config/

The most basic config file looks like this:

// vite.config.js
export default {
  // config options
}

Just create that file and paste that in. There's no vite equiv to npm init or tailwind init

Upvotes: 3

Related Questions