728x90
main.js
import Vue from "vue";
import App from "./App.vue";
import "tailwindcss/tailwind.css"; ๐
import "@/src/assets/global.css"; ๐
new Vue({
render: (h) => h(App),
}).$mount("#app");
tailwind.config.js
module.exports = {
purge: ['./src/**/*.html', './src/**/*.js'], // ๐
prefix: 'tw-',
// ...
}
postcss.config.js
ํ๋ก์ ํธ ํ ๊ฒฝ๋ก์ postcss.config.js ํ์ผ ์์ฑ ํ ๋ค์์ ์์ฑ
const autoprefixer = require("autoprefixer");
const tailwindcss = require("tailwindcss");
module.exports = {
plugins: [autoprefixer, tailwindcss],
};
vue.config.js
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
resolve: {
alias: {
"@": path.join(__dirname, "/"),
},
},
module: { ๐
rules: [
{
test: /\.css$/,
use: ["postcss-loader"],
},
],
},
},
});
์ฐธ์ฌ
ํด๊ฒฐ ๋ฐฉ๋ฒ
1. vue add tailwind
ํฐ๋ฏธ๋์ ํ๋ก์ ํธ ๊ฒฝ๋ก์์ ๋ค์ ๋ช ๋ น์ด ์ ๋ ฅ
vue add tailwind
none ์ค์ (๋๋ ๊ธฐ์กด์ ์ฌ์ฉํ๋ tailwind.config.js๊ฐ ์์.)
> src/assets/tailwind.css๊ฐ ์๋์ผ๋ก ์์ฑ๋จ.
2. ๊ธฐ์กด์ ์๋ tailwind.config.js์ ๋ค์ ์ค์ ๋ณ๊ฒฝ
module.exports = {
purge: ['./src/**/*.html', './src/**/*.{js,ts,vue}'], // ๐
prefix: 'tw-',
// ...
}
3. ./src/main.ts
import '@/assets/tailwind.css';
// ...
๊ฒฐ๊ณผ ํ์ธ
728x90
'Vue.js' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Vue.js] v-html์ ์ฌ์ฉํ์ง ๋ง์ธ์. (0) | 2022.05.27 |
---|---|
[Vuejs] ์ํฐ๋ก ์๋ธ๋ฐ ๋ณด๋ด๊ธฐ (0) | 2022.05.11 |
[Vuetify] v-btn hover effect circle -> square shape๋ก ๋ณ๊ฒฝํ๊ธฐ (0) | 2022.01.04 |
[Vuetify] global font family ์ค์ ํ๋ ๋ฐฉ๋ฒ (0) | 2021.12.24 |
[Vue2 + SASS] ์ ์ญ์ผ๋ก SCSS ์ ์ฉํ๊ธฐ (0) | 2021.12.11 |
๋๊ธ