forked from likecoin/likecoin-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
36 lines (33 loc) · 847 Bytes
/
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
// Rollup plugins
import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import { uglify } from 'rollup-plugin-uglify';
function createConfig(filename) {
return {
input: `likecoin/js/${filename}`,
output: {
file: `likecoin/assets/js/${filename}`,
format: 'iife',
sourcemap: true,
},
plugins: [
nodeResolve({
browser: true,
}),
commonjs({
include: 'node_modules/**',
}),
babel({
runtimeHelpers: true,
exclude: 'node_modules/**',
}),
(process.env.NODE_ENV === 'production' && uglify()),
],
};
}
const configs = [
'admin/likecoin_editor.js',
'admin/likecoin_metabox.js',
].map((filename) => createConfig(filename));
export default configs;