-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.js
41 lines (40 loc) · 956 Bytes
/
rollup.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 {eslint} from 'rollup-plugin-eslint';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import {terser} from 'rollup-plugin-terser';
export default [{
input: 'src/js/player51.js',
output: [
{
file: 'build/cjs/player51.min.js',
format: 'cjs',
name: 'Player51',
},
{
file: 'build/iife/player51.min.js',
format: 'iife',
name: 'Player51',
},
],
plugins: [
resolve(),
commonjs(),
eslint({
exclude: [
'node_modules/**',
'src/css/**',
],
}),
babel({
exclude: 'node_modules/**',
}),
replace({
exclude: 'node_modules/**',
ENV: JSON.stringify(process.env.NODE_ENV || 'dev'),
}),
((process.env.NODE_ENV === 'prod' || process.env.NODE_ENV === 'production')
&& terser()),
],
}];