forked from Amphiluke/handy-scroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
45 lines (42 loc) · 1.12 KB
/
rollup.config.mjs
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
import pkg from "./package.json" assert {type: "json"};
import babel from "@rollup/plugin-babel";
import terser from "@rollup/plugin-terser";
let config = {
input: "src/handy-scroll.js",
output: {
format: "umd",
name: "handyScroll",
banner: `/*!
${pkg.name} v${pkg.version}
${pkg.homepage}
(c) ${new Date().getUTCFullYear()} ${pkg.author}
*/`
}
};
let plugins = {
terser: terser({
output: {comments: /^!/}
}),
babel: babel({babelHelpers: "bundled"})
};
export default [
{
input: config.input,
output: {...config.output, file: "dist/handy-scroll.es6.js", generatedCode: "es2015"}
},
{
input: config.input,
output: {...config.output, file: "dist/handy-scroll.es6.min.js", generatedCode: "es2015"},
plugins: [plugins.terser]
},
{
input: config.input,
output: {...config.output, file: "dist/handy-scroll.js"},
plugins: [plugins.babel]
},
{
input: config.input,
output: {...config.output, file: "dist/handy-scroll.min.js"},
plugins: [plugins.babel, plugins.terser]
}
];