dominoclock/vite.config.js

36 lines
915 B
JavaScript
Raw Normal View History

2021-11-17 00:45:48 +00:00
import path from "path";
import viteCompression from "vite-plugin-compression";
import eslintPlugin from "vite-plugin-eslint";
const config = (mode) => ({
plugins: [
viteCompression({ filter: /\.(js|css|map)$/, algorithm: "gzip", ext: ".gz" }),
viteCompression({ filter: /\.(js|css|map)$/, algorithm: "brotliCompress", ext: ".br" }),
eslintPlugin({ cache: true }),
],
sourcemap: mode === "development",
build: {
outDir: "build",
2021-11-18 00:02:46 +00:00
assetDir: "./assets",
2021-11-17 00:45:48 +00:00
sourcemap: mode === "development",
minify: !mode === "development",
brotliSize: false,
emptyOutDir: true,
},
optimizeDeps: {
allowNodeBuiltins: false,
},
server: {
proxy: {
// Allows us to run the proxy server independent of the content, and still
// get full-service.
},
},
});
export default config;