mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-19 14:59:28 +00:00
37 lines
678 B
TypeScript
37 lines
678 B
TypeScript
import { defineConfig } from 'vite';
|
|
import { minify as htmlMinify } from 'html-minifier-terser';
|
|
|
|
export default defineConfig({
|
|
appType: 'mpa',
|
|
base: '/editor/',
|
|
build: {
|
|
minify: true,
|
|
sourcemap: true,
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
'/s': {
|
|
target: 'http://localhost:5000',
|
|
},
|
|
},
|
|
},
|
|
|
|
plugins: [
|
|
{
|
|
name: 'html-minifier',
|
|
transformIndexHtml: {
|
|
order: 'post',
|
|
handler(html) {
|
|
return htmlMinify(html, {
|
|
collapseWhitespace: true,
|
|
removeComments: true,
|
|
minifyCSS: true,
|
|
minifyJS: true,
|
|
});
|
|
},
|
|
},
|
|
},
|
|
],
|
|
});
|