-
Notifications
You must be signed in to change notification settings - Fork 19
/
rollup.config.js
70 lines (65 loc) · 2.16 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// import resolve from 'rollup-plugin-node-resolve';
// import commonjs from 'rollup-plugin-commonjs';
// import builtins from 'rollup-plugin-node-builtins';
// import globals from 'rollup-plugin-node-globals';
import buble from '@rollup/plugin-buble';
import {eslint} from 'rollup-plugin-eslint';
import pkg from './package.json';
export default [
// browser-friendly UMD build
{
input: pkg.module,
output: {
file: pkg.browser,
format: 'iife',
sourcemap: true,
name: 'leafdoc'
},
plugins: [
// eslint(),
buble(),
// resolve(), // so Rollup can find `crc32`
// commonjs(),
// builtins(),
// globals()
],
external: ['fs', 'path']
},
// CommonJS (for Node) and ES module (for bundlers) build.
// (We could have three entries in the configuration array
// instead of two, but it's quicker to generate multiple
// builds from a single configuration where possible, using
// the `targets` option which can specify `dest` and `format`)
{
input: pkg.module,
// external: ['buffer', 'fs', 'jszip', 'debug'],
output: [
{ file: pkg.main, format: 'cjs', sourcemap: true },
// { file: pkg.module, format: 'es', sourcemap: true }
],
plugins: [
eslint(),
buble(),
// resolve(), // so Rollup can find `crc32`
// commonjs() // so Rollup can convert `crc32` to an ES module
],
external: ['fs', 'path']
},
// Experimental code-splitting build, for exposing all modules (for unit testing)
{
input: [pkg.module, 'src/parsers/multilang.mjs', 'src/parsers/trivial.mjs'],
experimentalCodeSplitting: true,
experimentalDynamicImport: true,
output: {
dir: 'dist/split',
format: 'cjs'
},
plugins: [
eslint(),
buble(),
// resolve(), // so Rollup can find `crc32`
// commonjs() // so Rollup can convert `crc32` to an ES module
],
external: ['fs', 'path']
}
];