Init
This commit is contained in:
51
vite.config.js
Executable file
51
vite.config.js
Executable file
@@ -0,0 +1,51 @@
|
||||
import FastGlob from 'fast-glob'
|
||||
import { resolve } 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';
|
||||
|
||||
const reload = {
|
||||
name: 'reload',
|
||||
handleHotUpdate({ file, server }) {
|
||||
if (!file.includes('temp') && file.endsWith(".php") || file.endsWith(".latte")) {
|
||||
server.ws.send({
|
||||
type: 'full-reload',
|
||||
path: '*',
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
plugins: [reload, vue()],
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [postcssImport, tailwindcssNesting(postcssNesting), postcssCustomMedia, tailwindcss, autoprefixer]
|
||||
}
|
||||
},
|
||||
server: {
|
||||
watch: {
|
||||
usePolling: true
|
||||
},
|
||||
hmr: {
|
||||
host: 'localhost'
|
||||
}
|
||||
},
|
||||
build: {
|
||||
manifest: true,
|
||||
outDir: "www",
|
||||
emptyOutDir: false,
|
||||
rollupOptions: {
|
||||
input: FastGlob.sync(['./src/scripts/*.js', './src/styles/*.css']).map(entry => resolve(process.cwd(), entry)),
|
||||
plugins: [
|
||||
vue()
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user