-
Notifications
You must be signed in to change notification settings - Fork 111
/
rollup.config.js
41 lines (37 loc) · 969 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
35
36
37
38
39
40
41
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import progress from 'rollup-plugin-progress';
import builtinModules from 'builtin-modules';
import * as lsp from 'vscode-languageserver-protocol';
const isProduction = process.env.NODE_ENV === 'production';
const config = {
input: {
index: './lib/index.js',
},
output: {
dir: 'build',
format: 'cjs',
sourcemap: true,
},
plugins: [
nodeResolve(),
babel({ babelHelpers: 'bundled', exclude: 'node_modules/**' }),
commonjs(),
isProduction ? terser() : null,
progress(),
],
external: [
'vscode',
// contains binary files
'flow-bin',
// very slow to build
'prettier/standalone',
'prettier/parser-flow',
].concat(
// to hide builtin module warning
builtinModules,
),
};
export default config;