-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.canvas.ts
42 lines (41 loc) · 1.03 KB
/
vite.config.canvas.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
41
42
import path from "node:path";
import { defineConfig } from "vite";
import generateFile from "vite-plugin-generate-file";
import { viteSingleFile } from "vite-plugin-singlefile";
import figmaManifest from "./manifest";
import commonjs from "vite-plugin-commonjs";
export default defineConfig(({ mode }) => ({
plugins: [
viteSingleFile(),
generateFile({
type: "json",
output: "./manifest.json",
data: figmaManifest,
}),
commonjs(),
],
build: {
minify: mode === "production",
// sourcemap: mode !== 'production' ? 'inline' : false,
sourcemap: false,
target: "es2017",
emptyOutDir: false,
outDir: path.resolve("dist"),
commonjsOptions: {
transformMixedEsModules: true,
},
rollupOptions: {
input: path.resolve("src/main.ts"),
output: {
entryFileNames: "main.js",
},
},
},
resolve: {
alias: {
services: path.resolve("src/services"),
utilities: path.resolve("src/utilities"),
types: path.resolve("src/types"),
},
},
}));