-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.js
74 lines (64 loc) · 1.99 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import svgLoader from 'vite-svg-loader';
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';
import dts from 'vite-plugin-dts';
import _package from './package.json';
const { version } = _package;
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('liquidswap-')
}
}
}),
dts(),
svgLoader({
defaultImport: 'url'
}),
chunkSplitPlugin()
],
resolve:{
alias:{
'@' : resolve(__dirname, './src')
},
},
optimizeDeps: {
include: ['vue', '@vueuse/core'],
},
css: {
postcss: 'sass',
},
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'index.ts'),
name: 'Liquidswap widget',
formats: ['es'],
// the proper extensions will be added
fileName: 'index',
},
commonjsOptions: {
include: [/node_modules/],
},
// Reduce bloat from legacy polyfills.
target: 'esnext',
outDir: 'dist',
sourcemap: true,
},
define: {
'process.env.NODE_ENV': '"production"',
'process.env.VUE_APP_CORRECT_CHAIN': '"mainnet"',
'process.env.VERSION': `"${version}"`,
// For testnet environment:
// 'process.env.VUE_APP_MODULES_ACCOUNT': '"0x190d44266241744264b964a37b8f09863167a12d3e70cda39376cfb4e3561e12"',
// 'process.env.VUE_APP_MODULES_V05_ACCOUNT': '"0x45ef7a3a1221e7c10d190a550aa30fa5bc3208ed06ee3661ec0afa3d8b418580"',
// 'process.env.VUE_APP_RESOURCES_ACCOUNT': '"0x05a97986a9d031c4567e15b797be516910cfcb4156312482efc6a19c0a30c948"',
// 'process.env.VUE_APP_RESOURCES_V05_ACCOUNT': '"0x9cc3c27b8d398ab6fc82cbc9dc6b43bb9164f72da465631628163822662a8580"',
// 'process.env.VUE_APP_COINS_ACCOUNT': '"0x43417434fd869edee76cca2a4d2301e528a1551b1d719b75c350c3c97d15b8b9"'
},
base: '/liquidswap-widget/',
});