Setting absolute paths in aliases to prevent warnings in Vite.js and fix the background-image reference to an image using eg. @images/bg.svg
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import laravel from 'laravel-vite-plugin'
|
|
import {
|
|
wordpressPlugin,
|
|
wordpressRollupPlugin,
|
|
wordpressThemeJson,
|
|
} from './resources/js/build/wordpress'
|
|
|
|
export default defineConfig({
|
|
base: '/app/themes/sage/public/build/',
|
|
plugins: [
|
|
tailwindcss(),
|
|
laravel({
|
|
input: [
|
|
'resources/css/app.css',
|
|
'resources/js/app.js',
|
|
'resources/css/editor.css',
|
|
'resources/js/editor.js',
|
|
],
|
|
refresh: true,
|
|
}),
|
|
|
|
wordpressPlugin(),
|
|
wordpressRollupPlugin(),
|
|
|
|
// Generate the theme.json file in the public/build/assets directory
|
|
// based on the Tailwind config and the theme.json file from base theme folder
|
|
wordpressThemeJson({
|
|
disableTailwindColors: false,
|
|
disableTailwindFonts: false,
|
|
disableTailwindFontSizes: false,
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@scripts': '/resources/js',
|
|
'@styles': '/resources/css',
|
|
'@fonts': '/resources/fonts',
|
|
'@images': '/resources/images',
|
|
},
|
|
},
|
|
})
|