Skip to content

Commit

Permalink
Use inline postcss config in vite.config.mts
Browse files Browse the repository at this point in the history
1. It's redundant to have both a postcss.config.js and a postcss key in vite.config.mts
2. If the css key is present in vite.config.mts, it will override the postcss.config.js file (https://vitejs.dev/config/shared-options.html#css-postcss)
3. Sine the css key was overriden in vite.config.mts, and it didn't have autoprefixer, CSS was not being autoprefixed
  • Loading branch information
davidalejandroaguilar authored Aug 27, 2024
1 parent 1d99aa0 commit 34e653d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions postcss.config.js

This file was deleted.

6 changes: 5 additions & 1 deletion vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'vite'
import RubyPlugin from 'vite-plugin-ruby'
import StimulusHMR from 'vite-plugin-stimulus-hmr'
import tailwindcss from "tailwindcss"
import autoprefixer from "autoprefixer"

export default defineConfig({
plugins: [
Expand All @@ -10,7 +11,10 @@ export default defineConfig({
],
css: {
postcss: {
plugins: [tailwindcss()],
plugins: [
tailwindcss(),
autoprefixer(),
],
}
},
optimizeDeps: { exclude: ["fsevents"] },
Expand Down

0 comments on commit 34e653d

Please sign in to comment.