-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
67 lines (64 loc) · 1.23 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
const fs = require('fs');
import cjs from 'rollup-plugin-cjs-es';
import buble from 'rollup-plugin-buble';
import { terser } from 'rollup-plugin-terser';
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const ver = "v" + pkg.version;
const urlVer = "https://github.com/leeoniya/notyet (" + ver + ")";
const banner = [
"/**",
"* Copyright (c) " + new Date().getFullYear() + ", Leon Sorokin",
"* All rights reserved. (MIT Licensed)",
"*",
"* notyet.js (NotYet)",
"* Lazy image & media loader",
"* " + urlVer,
"*/",
"",
].join("\n");
export default [
{
input: './src/notyet.js',
output: {
name: 'notyet',
file: './dist/notyet.umd.js',
format: 'umd',
banner,
},
plugins: [
cjs({nested: true, cache: false}),
buble(),
]
},
{
input: './src/notyet.js',
output: {
name: 'notyet',
file: './dist/notyet.cjs.js',
format: 'cjs',
banner,
},
plugins: [
cjs({nested: true, cache: false}),
buble(),
]
},
{
input: './src/notyet.js',
output: {
name: 'notyet',
file: './dist/notyet.min.js',
format: 'umd',
banner: "/*! " + urlVer + " */",
},
plugins: [
cjs({nested: true, cache: false}),
buble(),
terser({
output: {
comments: /^!/
}
}),
]
},
]