-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
46 lines (46 loc) · 1.13 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import path from "path";
import { defineConfig } from "vite";
import pkg from './package.json';
export default defineConfig(({ mode }) => {
const isProd = mode === "production";
const external = Object.keys({
...pkg.peerDependencies
});
return {
define: {
'process.env.NODE_ENV': '"production"',
__VERSION__: JSON.stringify(pkg.version),
},
css: {
modules:{
generateScopedName:'[name]__[local]__[hash:base64:5]',
hashPrefix:'prefix',
},
preprocessorOptions:{
less:{}
}
},
build: {
target:['es2015'],
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
formats: ['iife', 'es', "cjs"],
name: 'NetlessAppLittleBoard',
fileName: 'index'
},
outdir: "dist",
sourcemap: true,
// rollupOptions: {
// external,
// output:{
// globals:{
// whiteWebSdk: 'white-web-sdk',
// appliancePlugin: '@netless/appliance-plugin',
// windowManager: '@netless/window-manager'
// }
// }
// },
minify: isProd,
}
};
});