-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
61 lines (58 loc) · 1.72 KB
/
Copy pathvite.config.js
File metadata and controls
61 lines (58 loc) · 1.72 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// import { splitVendorChunkPlugin } from "vite";
import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
// import { dependencies } from "./package.json";
// function renderChunks(deps) {
// let chunks = {};
// Object.keys(deps).forEach((key) => {
// if (["react", "react-router-dom", "react-dom"].includes(key)) return;
// chunks[key] = [key];
// });
// return chunks;
// }
export default defineConfig(({ mode }) => {
// const env = loadEnv(mode, process.cwd());
return {
plugins: [react()],
// base: import.meta.env.BASE_URL,
// base: env.VITE_BASE_URL,
base: "/affirmations-vite/",
// build section added to stop size warnings during deploy processes
// consider changing in the future, as this is a temporary fix
// build: {
// sourcemap: false,
// chunkSizeWarningLimit: 100,
// rollupOptions: {
// output: {
// manualChunks: {
// vendor: ["react", "react-router-dom", "react-dom"],
// ...renderChunks(dependencies),
// },
// },
// onwarn(warning, warn) {
// if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
// return;
// }
// warn(warning);
// },
// },
// },
// build: {
// rollupOptions: {
// output: {
// manualChunks(id) {
// if (id.includes("node_modules")) {
// return id
// .toString()
// .split("node_modules/")[1]
// .split("/")[0]
// .toString();
// }
// },
// },
// },
// },
// plugins: [react(), splitVendorChunkPlugin()],
root: "src",
};
});