forked from malec-palec/xiii-floor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
35 lines (34 loc) · 1008 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { advzipPlugin, defaultAdvzipOptions, defaultEctOptions, ectPlugin } from "js13k-vite-plugins";
import { defineConfig } from "vite";
import { createHtmlPlugin } from "vite-plugin-html";
import { viteSingleFile } from "vite-plugin-singlefile";
export default defineConfig({
base: "./",
plugins: [
viteSingleFile({ useRecommendedBuildConfig: false, removeViteModuleLoader: true }),
createHtmlPlugin({ minify: true }),
ectPlugin(defaultEctOptions),
advzipPlugin(defaultAdvzipOptions),
{
name: "final-transformations",
enforce: "post",
renderChunk: async (code: string) => {
return {
// @ts-expect-error trust me - it's ES2021
code: code.replaceAll("const ", "let "),
map: null,
};
},
},
],
build: {
assetsDir: ".",
assetsInlineLimit: 0,
cssCodeSplit: false,
rollupOptions: {
output: {
assetFileNames: "[name].[ext]", // Keep original asset names
},
},
},
});