-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.inpage.ts
More file actions
39 lines (38 loc) · 973 Bytes
/
vite.config.inpage.ts
File metadata and controls
39 lines (38 loc) · 973 Bytes
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
import { defineConfig } from 'vite';
import { resolve } from 'path';
/**
* Vite config for building the inpage provider script
*
* This script is injected into web pages and provides the window.keplr API.
* It must be built as a self-contained IIFE with no external dependencies.
*/
export default defineConfig({
build: {
outDir: 'dist',
emptyOutDir: false,
lib: {
entry: resolve(__dirname, 'src/content/inpage.ts'),
name: 'inpage',
formats: ['iife'],
fileName: () => 'inpage.js',
},
rollupOptions: {
output: {
entryFileNames: 'inpage.js',
format: 'iife',
// Don't mangle certain names that dApps might check
manualChunks: undefined,
},
},
// Inline all dependencies - the inpage script must be self-contained
commonjsOptions: {
include: [],
},
minify: 'esbuild',
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
});