forked from seth/ipv4.army
Refactor: Vite
This commit is contained in:
parent
69f8f74182
commit
7fd41cd78c
22 changed files with 569 additions and 413 deletions
26
vite.config.ts
Normal file
26
vite.config.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
/// <reference types="vite/client" />
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import preact from '@preact/preset-vite'
|
||||
|
||||
import postCSSPurgeCSS from "@fullhuman/postcss-purgecss";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
css: {
|
||||
...(import.meta.env.NODE_ENV === "production") ? {
|
||||
transformer: "postcss",
|
||||
postcss: {
|
||||
plugins: [
|
||||
postCSSPurgeCSS({
|
||||
content: ["./index.html", "./src/**/*.{ts,tsx}"],
|
||||
})
|
||||
]
|
||||
}
|
||||
} : {transformer: "lightningcss"}
|
||||
},
|
||||
build: {
|
||||
cssMinify: "lightningcss",
|
||||
},
|
||||
plugins: [preact()],
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue