forked from pods-framework/pods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
61 lines (59 loc) · 1.44 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
import includePaths from 'rollup-plugin-includepaths';
import replace from 'rollup-plugin-replace';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import html from 'rollup-plugin-html';
import babel from 'rollup-plugin-babel';
import { uglify } from 'rollup-plugin-uglify';
const includePathOptions = {
include: {},
paths: [ 'ui/js' ],
external: [],
extensions: [ '.js', '.html' ]
};
export default {
input: 'ui/js/pods-dfv/_src/pods-dfv.js',
output: {
file: 'ui/js/pods-dfv/pods-dfv.min.js',
format: 'iife',
name: 'PodsDFV', // One single object added to the global namespace
globals: {
'jquery': 'jQuery',
'underscore': '_',
'backbone': 'Backbone',
'backbone.marionette': 'Marionette'
},
sourcemap: true
},
external: [
'jquery',
'underscore',
'backbone',
'backbone.marionette'
],
plugins: [
includePaths( includePathOptions ),
html(),
replace( {
// Needed for React, see https://github.com/rollup/rollup/issues/487#issuecomment-177596512
'process.env.NODE_ENV': JSON.stringify( 'production' )
} ),
nodeResolve(),
commonjs( {
include: 'node_modules/**'
} ),
babel( {
babelrc: false, // Ignore the .babelrc file which is there for mocha tests
ignore: [ 'node_modules/**' ],
presets: [
[ 'env', { modules: false } ],
[ 'react' ]
],
plugins: [
'transform-object-rest-spread',
'external-helpers'
]
} ),
uglify()
]
};