-
Notifications
You must be signed in to change notification settings - Fork 576
/
rollup.config.js
64 lines (54 loc) · 1.33 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
import resolve from '@rollup/plugin-node-resolve';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import replace from '@rollup/plugin-replace';
import markdown from '@jackfranklin/rollup-plugin-markdown';
import css from 'rollup-plugin-import-css';
import copy from 'rollup-plugin-copy';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'iife',
sourcemap: true,
strict: false
},
plugins: [
commonjs({
include: ['./src/**/*', './node_modules/**/*'],
transformMixedEsModules: true
}),
replace({
'require.main === module': 'false' // jsonhint export quirk
}),
resolve({
browser: true,
preferBuiltins: true
}),
json(),
nodePolyfills(),
markdown(),
css({
output: './dist/css/bundle.css',
minify: production
}),
copy({
targets: [
{
src: 'node_modules/@fortawesome/fontawesome-free/webfonts',
dest: './dist'
},
{
src: 'node_modules/@mapbox/maki/icons',
dest: './dist'
},
{
src: 'img/marker-chars/*.svg',
dest: './dist/icons'
}
]
})
]
};