-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrollup.config.js
More file actions
105 lines (104 loc) · 2.14 KB
/
rollup.config.js
File metadata and controls
105 lines (104 loc) · 2.14 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import babel from 'rollup-plugin-babel';
import bundleSize from 'rollup-plugin-bundle-size';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import visualizer from 'rollup-plugin-visualizer';
export default [
// production IIFE release
{
input: 'src/index.js',
output: {
file: 'dist/feed-media-audio-player.min.js',
format: 'iife',
name: 'Feed'
},
plugins: [
json({ // so we can get version
include: 'package.json',
preferConst: false,
compact: true,
namedExports: true
}),
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**'
}),
terser({
output: {
ascii_only: true
}
}),
bundleSize()
]
},
// production CJS release
{
input: 'src/index.js',
output: {
file: 'lib/index.js',
format: 'cjs',
},
external: [
'tiny-cookie'
],
plugins: [
json({ // so we can get version
include: 'package.json',
preferConst: false,
compact: true,
namedExports: true
}),
babel({
exclude: 'node_modules/**'
}),
bundleSize()
]
},
// internal development and testing
{
input: 'src/index.js',
output: {
file: 'build/feed.js',
format: 'iife',
name: 'Feed',
sourcemap: true
},
plugins: [
json({ // so we can get version
include: 'package.json',
preferConst: true,
indent: ' ',
compact: true,
namedExports: true
}),
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**'
}),
visualizer({
filename: 'build/statistics.html'
}),
bundleSize()
]
},
{
input: 'test/player.js',
output: {
file: 'build/player.js',
format: 'iife',
sourcemap: true
},
plugins: [
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**',
runtimeHelpers: true
})
]
}
];