From 34e653df40ce8d40950d964145af00eafc6a620f Mon Sep 17 00:00:00 2001 From: David Alejandro <15317732+davidalejandroaguilar@users.noreply.github.com> Date: Tue, 27 Aug 2024 00:41:35 +0000 Subject: [PATCH] Use inline postcss config in vite.config.mts 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 --- postcss.config.js | 6 ------ vite.config.mts | 6 +++++- 2 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 postcss.config.js diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index 33ad091..0000000 --- a/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/vite.config.mts b/vite.config.mts index 1a073fc..84fb098 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -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: [ @@ -10,7 +11,10 @@ export default defineConfig({ ], css: { postcss: { - plugins: [tailwindcss()], + plugins: [ + tailwindcss(), + autoprefixer(), + ], } }, optimizeDeps: { exclude: ["fsevents"] },