Created
February 3, 2023 18:41
-
-
Save clandestine8/163ff522aae0b7d0a23397bf9256cf3b to your computer and use it in GitHub Desktop.
Vue3 + Tailwind + SASS + Vite with Instant Hot Reload setup using PostCSS Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "vue-project", | |
"version": "0.0.0", | |
"private": true, | |
"scripts": { | |
"dev": "vite", | |
"build": "vite build", | |
"preview": "vite preview" | |
}, | |
"dependencies": { | |
// "pinia": "^2.0.28", | |
// "vue-router": "^4.1.6", | |
"vue": "^3.2.45", | |
}, | |
"devDependencies": { | |
"@csstools/postcss-sass": "^5.0.1", | |
"@vitejs/plugin-vue": "^4.0.0", | |
"autoprefixer": "^10.4.13", | |
"postcss": "^8.4.21", | |
"postcss-scss": "^4.0.6", | |
"tailwindcss": "^3.2.4", | |
"vite": "^4.0.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {import('tailwindcss').Config} */ | |
module.exports = { | |
content: [ | |
"./index.html", | |
"./src/**/*.{vue,js,ts,jsx,tsx}", | |
], | |
theme: { | |
extend: {}, | |
}, | |
plugins: [], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'vite' | |
import vue from '@vitejs/plugin-vue' | |
import sassSyntax from 'postcss-scss'; | |
import sassPlugin from '@csstools/postcss-sass'; | |
import tailwindcss from 'tailwindcss' | |
import autoprefixer from 'autoprefixer' | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [vue()], | |
css: { | |
postcss: { | |
syntax: sassSyntax, | |
plugins: [ | |
sassPlugin(), | |
tailwindcss(), | |
autoprefixer(), | |
] | |
}, | |
}, | |
resolve: { | |
alias: { | |
'@': fileURLToPath(new URL('./src', import.meta.url)) | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment