forked from daniel3735928559/guppy
-
Notifications
You must be signed in to change notification settings - Fork 5
/
rollup.config.js
32 lines (31 loc) · 1008 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
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import { uglify } from 'rollup-plugin-uglify';
import json from 'rollup-plugin-json';
export default {
input: 'src/guppy.js',
output: {name:'Guppy',
file:process.env.NODE_ENV === 'production' ? 'build/guppy.min.js' :( process.env.NODE_ENV === 'test' ? 'build/guppy-test.js' : 'build/guppy.js'),
format: 'iife'},
plugins: [
commonjs({
include: [
'lib/mousetrap/**',
'lib/katex/**'
],
namedExports: { 'mousetrap': ['Mousetrap'] }
}),
json({
include: ['sym/**']
}),
babel({
exclude: 'node_modules/**',
presets: [['es2015', { "modules": false }]],
plugins: (process.env.NODE_ENV === 'test' ? [['istanbul', {"include": ['src/**']}]] : [])
}),
//(process.env.NODE_ENV === 'test' && istanbul({
// include: ['src/**']
//})),
(process.env.NODE_ENV === 'production' && uglify()),
],
};