-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
95 lines (95 loc) · 2.26 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
const typescript = require('rollup-plugin-typescript');
const uglify = require('rollup-plugin-uglify');
const uglifyEs = require("rollup-plugin-uglify-es");
const license = require('rollup-plugin-license');
const camelCase= require("lodash.camelCase");
const banner=`@license <%= pkg.name %> v<%= pkg.version %>
(c) <%= moment().format('YYYY') %> Finsi, Inc.
`,
name = "jquery.cards-quiz",
fileName=name,
packageName =camelCase(name.replace("jquery","jq")),
src = "./src/index.ts",
external=(id)=>id.indexOf("node_modules")!=-1,
globals= {
jquery: '$'
};
module.exports= [
{
input: src,
output: {
file: `dist/${name}.js`,
name:packageName,
format: 'umd',
globals:globals
},
plugins: [
typescript({
typescript:require("typescript"),
}),
license({
banner:banner
})
],
external:external
},
//min
{
input: src,
output: {
file: `dist/${name}.min.js`,
name:packageName,
format: 'umd',
globals:globals
},
plugins: [
typescript({
typescript:require("typescript"),
}),
uglify(),
license({
banner:banner
})
],
external:external
},
//esm2015
{
input: src,
output: {
file: `esm2015/${fileName}.js`,
name:packageName,
format: 'es'
},
plugins: [
typescript({
typescript:require("typescript"),
target:"es2015"
}),
license({
banner:banner
})
],
external:external
},
//esm2015 min
{
input: src,
output: {
file: `esm2015/${fileName}.min.js`,
name:packageName,
format: 'es'
},
plugins: [
typescript({
typescript:require("typescript"),
target:"es2015"
}),
uglifyEs(),
license({
banner:banner
})
],
external:external
}
];