-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
31 lines (28 loc) · 854 Bytes
/
vite.config.js
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
import { defineConfig, loadEnv, splitVendorChunkPlugin } from "vite";
import { svelte } from '@sveltejs/vite-plugin-svelte'
import replace from "@rollup/plugin-replace";
import styles from 'rollup-plugin-styles';
// https://vitejs.dev/config/
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
const isUI5 = mode === "UI5";
return defineConfig({
plugins: [
svelte(),
splitVendorChunkPlugin(),
replace({ "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV) }),
],
build: isUI5
? {
outDir: "distUI5",
target: "esnext",
lib: {
entry: "src/UI5.main.ts",
name: "sveltetodo",
fileName: "sveltetodo" ,
formats: ["umd"]
},
}
: undefined ,
});
}