-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
50 lines (44 loc) · 1.19 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
import legacy from "rollup-plugin-legacy"
import string from "rollup-plugin-string"
import uglify from "rollup-plugin-uglify"
import buble from "rollup-plugin-buble"
import alias from "rollup-plugin-alias"
import commonjs from "rollup-plugin-commonjs"
const min = !!process.env.MIN
const name = "luminate-embed-0.0.3"
let dest = "build/" + name + ".js"
const plugins = [
legacy({
"vendor/luminateExtend-1.8.1.js": "luminateExtend"
}),
string({
include: "**/*.css"
}),
buble(),
alias({
"es6-promise": __dirname + "/node_modules/es6-promise/dist/es6-promise.js",
"luminateExtend": __dirname + "/vendor/luminateExtend-1.8.1.js",
"spin.js": __dirname + "/vendor/spin-2.3.2.js",
"underscore": __dirname + "/node_modules/underscore-es"
}),
commonjs({
include: "node_modules/**",
sourceMap: false
})
]
if (min) {
dest = "build/" + name + ".min.js"
// Set IE8 compatibility flags for stuff like `.catch` -> `["catch"]`.
plugins.push(uglify({
compress: { screw_ie8: false },
mangle: { screw_ie8: false },
output: { screw_ie8: false },
}))
}
export default {
entry: "src/index.js",
format: "iife",
moduleName: "luminate-embed",
dest,
plugins
}