wip: support vite

This commit is contained in:
vben
2021-01-09 23:28:52 +08:00
parent 1d3007f030
commit 99ac309fa9
105 changed files with 954 additions and 2170 deletions

12
build/vite/plugin/gzip.ts Normal file
View File

@@ -0,0 +1,12 @@
import gzipPlugin from 'rollup-plugin-gzip';
import { isBuildGzip } from '../../utils';
import { Plugin } from 'vite';
export function configGzipPlugin(isBuild: boolean): Plugin | Plugin[] {
const useGzip = isBuild && isBuildGzip;
if (useGzip) {
return gzipPlugin();
}
return [];
}