import FastGlob from 'fast-glob' import { resolve, path } from 'path' import tailwindcss from 'tailwindcss' import tailwindcssNesting from 'tailwindcss/nesting/index.js' import autoprefixer from 'autoprefixer' import postcssImport from 'postcss-import' import postcssNesting from 'postcss-nesting' import postcssCustomMedia from 'postcss-custom-media' import dynamicImportVars from '@rollup/plugin-dynamic-import-vars' import vue from '@vitejs/plugin-vue' import { defineConfig } from 'vite' const reload = { name: 'reload', handleHotUpdate({ file, server }) { if ( (!file.includes('temp') && file.endsWith('.php')) || file.endsWith('.latte') ) { server.ws.send({ type: 'full-reload', path: '*', }) } }, } const assets = (url) => { return { name: 'asset-base-url', enforce: 'post', transform: (code) => { code = code.replace( /(from |import\()("|'|`)(\/src|~?@|\/@fs\/@)\/(.*?)\.(svg|png|mp3|mp4)/g, `$1$2${url}/src/$4.$5?import=` ) code = code.replace( /(? resolve(process.cwd(), entry)) }, }, })