-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
40 lines (36 loc) · 1.03 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
// @ts-check
const path = require('path')
const { defineConfig } = require('vite')
module.exports = defineConfig(({command, mode})=>{
const config = {
build: {
emptyOutDir: false,
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'ein',
fileName: (format) => mode === 'development' ? `ein.dev.${format}.js` : `ein.${format}.js`
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
// external: ['vue'],
// output: {
// // Provide global variables to use in the UMD build
// // for externalized deps
// globals: {
// vue: 'Vue'
// }
// }
}
},
define: {
// '__HOT__': 'import.meta.hot',
__vite_process_env_NODE_ENV: JSON.stringify('process.env.NODE_ENV'),
// 'import.meta.hot': 'import.meta.hot',
},
}
if(mode === 'development') {
config.define['import.meta.hot'] = 'import.meta.hot'
}
return config
})