-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
37 lines (33 loc) · 1009 Bytes
/
vite.config.js
File metadata and controls
37 lines (33 loc) · 1009 Bytes
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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/guide/build.html#library-mode
export default defineConfig({
plugins: [react()],
build: {
lib: {
entry: "src/index.js",
// Produce both ES module and CommonJS builds to match the old rollup output.
formats: ["es", "cjs"],
// Map format names to the file names expected by package.json.
fileName: (format) => (format === "es" ? "index.es.js" : "index.js"),
},
rollupOptions: {
// All peer dependencies must stay external so they are not bundled.
external: [
/^react(\/.*)?$/,
/^react-dom(\/.*)?$/,
/^react-intl(\/.*)?$/,
/^react-helmet(\/.*)?$/,
/^react-router(\/.*)?$/,
/^react-router-dom(\/.*)?$/,
/^@openimis\/.*/,
/^@mui\/.*/,
/^@material-ui\/.*/,
"prop-types",
"@vladmandic/face-api",
"qrcode.react",
],
},
sourcemap: true,
},
});