forked from UnPuzzles/react-mini-tg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
40 lines (39 loc) · 1.02 KB
/
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
36
37
38
39
40
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { nodePolyfills } from "vite-plugin-node-polyfills";
const htmlImport = {
name: "htmlImport",
/**
* Checks to ensure that a html file is being imported.
* If it is then it alters the code being passed as being a string being exported by default.
* @param {string} code The file as a string.
* @param {string} id The absolute path.
* @returns {{code: string}}
*/
// transform(code, id) {
// if (/^.*\.html$/g.test(id)) {
// code = `export default \`${code}\``;
// }
// return { code };
// },
};
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), htmlImport],
base: "/react-mini-tg/",
build: {
minify: "terser",
terserOptions: {
compress: {
// drop_console: true,
// drop_debugger: true,
},
},
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
},
},
},
});