Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

n212's avatar
Level 2

Vite, Inertia and vue. How to add own sass file?

Using the Vite documentation I found here about Inertia.js, I run the following command to setup Inertia for my application.

npx @preset/cli apply laravel:inertia

This in turn created the follow in the vite.config.ts file.

**vite.config.ts`

import { defineConfig } from 'vite'
import tailwindcss from 'tailwindcss'
import autoprefixer from 'autoprefixer'
import laravel from 'vite-plugin-laravel'
import vue from '@vitejs/plugin-vue'
import inertia from './resources/scripts/vite/inertia-layout'

export default defineConfig({
	plugins: [
		inertia(),
		vue(),
		laravel({
			postcss: [
				tailwindcss(),
				autoprefixer(),
			],
		}),
	],
})

However, how can I now add my own js, css and sass files in here? The laravel({}) part used to be with an array, but now it's totally different with an object inside.

For example, I need to add the following scss file resources/sass/app.scss, how would I be able to do this in Vite? Thanks for any help.

0 likes
1 reply
Sinnbeck's avatar

It's like this

laravel({
            input: ['resources/sass/app.scss'], //add your js as well 
			postcss: [
				tailwindcss(),
				autoprefixer(),
			],
		}), 

Please or to participate in this conversation.