-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
58 lines (49 loc) · 1.58 KB
/
rollup.config.js
File metadata and controls
58 lines (49 loc) · 1.58 KB
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
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import pkg from './package.json'
import babel from 'rollup-plugin-babel'
import uglify from 'rollup-plugin-uglify'
import execute from 'rollup-plugin-execute'
import json from 'rollup-plugin-json'
import copy from './src/plugins/rollup-copy'
const production = !process.env.ROLLUP_WATCH
export default [
// 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, usin
// an array for the `output` option, where we can specify
// `file` and `format` for each target)
{
input: 'src/index.js',
external: ['ms'],
plugins: [
resolve(), // so Rollup can find `ms`
commonjs(), // so Rollup can convert `ms` to an ES module
json({
// All JSON files will be parsed by default,
// but you can also specifically include/exclude files
include: ['node_modules/**','package.json'],
// for tree-shaking, properties will be declared as
// variables, using either `var` or `const`
preferConst: true, // Default: false
// specify indentation for the generated default export —
// defaults to '\t'
indent: ' '
}),
copy({
src: './node_modules/figlet/fonts/Standard.flf',
targ: './fonts/Standard.flf'
})
],
output: [{
file: pkg.main,
format: 'cjs',
strict: false
}
],
banner: '#!/usr/bin/env node',
sourcemap: true,
external: Object.keys(pkg.dependencies)
}
]