forked from GoodBoyNinja/cep-symlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
51 lines (47 loc) · 1.57 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
47
48
49
50
51
// vite.config.js
import { resolve } from 'path';
import { defineConfig } from 'vite';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import path from "path-browserify";
import license from 'rollup-plugin-license';
let libName = 'cep-symlink';
export default defineConfig({
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'lib/main.ts'),
name: `${libName}`,
// the proper extensions will be added
fileName: (format) => `${libName}.${format}.js`,
},
rollupOptions: {
plugins: [
nodePolyfills(),
license({
sourcemap: true,
thirdParty: {
includePrivate: false, // Default is false.
output: {
file: path.join(__dirname, 'dist', 'dependencies.txt'),
encoding: 'utf-8', // Default is utf-8.
},
},
}),
],
external: ['fs', 'path', 'fs-extra', 'util', 'child_process', 'os', 'fs/promises', '#ansi-styles', '#ansi-styles', 'inquirer', 'is-elevated'],
output: {
globals: {
fs: 'fs',
path: 'path',
'fs-extra': 'fs-extra',
util: 'util',
}
}
}
},
resolve: {
alias: {
path: "path-browserify",
},
}
});