-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrollup.config.js
More file actions
33 lines (31 loc) · 821 Bytes
/
rollup.config.js
File metadata and controls
33 lines (31 loc) · 821 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
import typescript from 'rollup-plugin-typescript2';
import nodeResolve from 'rollup-plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
function plugins() {
return [nodeResolve(), typescript({
tsconfigOverride: {
compilerOptions: { module: 'esnext' }
}
})];
}
export default [{
input: './src/extension.ts',
plugins: plugins(),
output: [{
file: 'dist/extension.cjs.js',
format: 'cjs',
sourcemap: true
}, {
file: 'dist/extension.es.js',
format: 'es',
sourcemap: true
}]
}, {
input: './src/browser.ts',
plugins: plugins().concat(process.env.NODE_ENV === 'production' ? terser() : null),
output: [{
file: 'dist/browser.js',
format: 'umd',
sourcemap: true
}]
}];