-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mjs
40 lines (40 loc) · 1.54 KB
/
vite.config.mjs
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
// Utilities
import { defineConfig } from 'vite'
import { fileURLToPath, URL } from 'node:url'
// https://vitejs.dev/config/
export default defineConfig({
define: { 'process.env': {} },
resolve: {
alias: {
//https://vitejs.dev/guide/build.html#library-mode
'##': fileURLToPath(new URL('./',import.meta.url)),//might want to try # or @ again...
'src': fileURLToPath(new URL('./src', import.meta.url)),
},
extensions: [
'.js',
'.json',
'.mjs',
],
},
// build:[
build:{
lib:{ name:'vite-verify-treeshaking-demo', // not sure what this adds
// name:'random_name', // doesn't change the name...
// Could also be a dictionary or array of multiple entry points
// entry: fileURLToPath(new URL('./src/index.mjs', import.meta.url))
entry:[ //"entry" can be a dictionary or array of multiple entry points
fileURLToPath(new URL('./src/index.mjs', import.meta.url)),
fileURLToPath(new URL('./src/nested_function_static_example.mjs', import.meta.url)),
fileURLToPath(new URL('./src/location_old.mjs', import.meta.url)),
// fileURLToPath(new URL('./src/nested_function_static_example.mjs', import.meta.url)),
]
}
},
// {lib: {
// name:'vite-verify-treeshaking-demo', // not sure what this adds
// // name:'random_name', // doesn't change the name...
// // Could also be a dictionary or array of multiple entry points
// entry: fileURLToPath(new URL('./src/index.mjs', import.meta.url))
// }}
// ],//build
})