Compile tailwind css in vue component
I want tailwind css to compile in my vue components but somehow I can't get that to work.
What I tried so far
Added the components to the vite config options
export default defineConfig({
plugins: [
vue(),
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
'resources/js/components/**.vue', // here
],
refresh: true,
}),
],
});
Any ideas?
Best
@Sinnbeck No it is not a spa.
app.js
import { createApp } from 'vue/dist/vue.esm-bundler'
import VueInstantSearch from 'vue-instantsearch/vue3/es';
import MySearch from './components/MySearch.vue'
const app = createApp(VueInstantSearch)
app.component('my-search', MySearch)
app.mount('#app')
app.css
@import '/node_modules/instantsearch.css/themes/algolia-min.css';
@tailwind base;
@tailwind components;
@tailwind utilities;
@SmokeTM then just load the css file in @vite() in your layout
@vite(['resources/css/app.css', 'resources/js/app.js',])
export default defineConfig({
plugins: [
vue(),
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
});
@Sinnbeck Did that already but the css classes are not compiled in my vue components.
@SmokeTM did you tell tailwind to look in those? In the content array in the tailwind config
Please or to participate in this conversation.