This repository has been archived on 2024-01-24. You can view files and clone it, but cannot push or open issues or pull requests.
discard/vite.config.js
2022-11-24 09:47:07 -08:00

43 lines
1.1 KiB
JavaScript

import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import autoPreprocess from 'svelte-preprocess';
import { execSync } from "child_process";
import pkgjson from "./package.json" assert { type: "json" };
// https://vitejs.dev/config/
export default defineConfig({
root: "src",
plugins: [svelte({ preprocess: autoPreprocess() })],
build: {
sourcemap: true,
target: "esnext",
outDir: "../dist",
emptyOutDir: true,
rollupOptions: {
output: {
manualChunks: {
"emojibase-data": [
"emojibase-data/en/compact.json",
"emojibase-data/en/shortcodes/joypixels.json",
"emojibase-data/en/shortcodes/emojibase.json",
],
"sanitize-html": ["sanitize-html"],
"highlight.js": ["highlight.js"],
"lexical": ["lexical", "@lexical/selection", "@lexical/history", "@lexical/utils"],
}
}
}
},
define: {
DISCARD: {
package: pkgjson,
time: new Date(),
commit: execSync("git log -n 1 --oneline HEAD").toString().match(/[a-z0-9]+/)[0],
}
},
server: {
hmr: {
}
}
});