-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.mjs
57 lines (55 loc) · 1.31 KB
/
rollup.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import fs from 'fs/promises';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import nodePolyfills from 'rollup-plugin-node-polyfills'
import eta from 'rollup-plugin-eta';
const pkg = JSON.parse((await fs.readFile('package.json')).toString());
const extensions = ['.js', '.ts'];
export default [{
input: 'src/components/index.ts',
output: [
{
file: './out/webview.js',
format: 'esm',
sourcemap: true,
},
],
plugins: [
typescript({
tsconfig: './tsconfig.json',
declaration: false
}),
resolve({ extensions })
]
}, {
input: 'src/index.ts',
output: [
{
dir: 'out',
format: 'cjs',
sourcemap: true,
},
],
plugins: [
typescript({ tsconfig: './tsconfig.json' }),
resolve({ extensions }),
eta()
],
external: ['vscode']
}, {
input: 'src/index.ts',
output: [
{
file: './out/web.js',
format: 'cjs',
sourcemap: true,
},
],
external: ['vscode'],
plugins: [
nodePolyfills(),
typescript({ tsconfig: './tsconfig.json' }),
resolve({ extensions, browser: true }),
eta()
]
}];