38 lines
970 B
TypeScript
38 lines
970 B
TypeScript
import svelte from '@svitejs/vite-plugin-svelte';
|
|
import windiCSS from 'vite-plugin-windicss';
|
|
import { defineConfig } from 'vite';
|
|
//
|
|
export default defineConfig(({ command, mode }) => {
|
|
const isProduction = mode === 'production';
|
|
return {
|
|
base: './',
|
|
build: {
|
|
polyfillDynamicImport: false,
|
|
cssCodeSplit: false,
|
|
minify: isProduction
|
|
},
|
|
plugins: [
|
|
windiCSS({
|
|
//@ts-ignore
|
|
verbose: true,
|
|
silent: false,
|
|
debug: true,
|
|
config: 'tailwind.config.js', // tailwind config file path (optional)
|
|
compile: false, // false: interpretation mode; true: compilation mode
|
|
prefix: 'windi-', // set compilation mode style prefix
|
|
globalPreflight: true, // set preflight style is global or scoped
|
|
globalUtility: true // set utility style is global or scoped
|
|
}),
|
|
svelte({
|
|
//@ts-ignore
|
|
hot: !isProduction,
|
|
emitCss: true,
|
|
extensions: [ '.md', '.svx', '.svelte' ],
|
|
preprocess: [
|
|
//
|
|
]
|
|
})
|
|
]
|
|
};
|
|
});
|