forked from WalletConnect/web3modal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
34 lines (30 loc) · 758 Bytes
/
rollup.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
import esbuild from 'rollup-plugin-esbuild'
import litCss from 'rollup-plugin-lit-css'
import minifyHtml from 'rollup-plugin-minify-html-literals'
export default function createConfig(packageName) {
const sharedOutput = {
exports: 'named',
name: packageName,
sourcemap: true
}
const esbuildPlugin = esbuild({
minify: true,
tsconfig: './tsconfig.json',
platform: 'browser',
treeShaking: true,
loaders: {
'.json': 'json'
}
})
const litCssPlugin = litCss({
include: ['**/*.css'],
uglify: true
})
return [
{
input: './index.ts',
plugins: [litCssPlugin, minifyHtml.default(), esbuildPlugin],
output: [{ file: './dist/index.js', format: 'es', ...sharedOutput }]
}
]
}