-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
58 lines (56 loc) · 1.33 KB
/
rollup.config.mjs
File metadata and controls
58 lines (56 loc) · 1.33 KB
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
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import dts from 'rollup-plugin-dts';
import pkg from './package.json' assert { type: 'json' };
export default [
{
input: 'source/index.ts',
external: ['jquery'],
output: [
{
file: './build/jquery.syotimer.js',
format: 'iife',
globals: {
jquery: 'jQuery',
},
banner: `/**
* ${pkg.projectName} - ${pkg.description}
* @version: ${pkg.version}
* @author: ${pkg.author}
* @homepage: ${pkg.homepage}
* @repository: ${pkg.repository.url}
* @license: under MIT license
*/`,
},
{
file: './build/jquery.syotimer.min.js',
format: 'iife',
globals: {
jquery: 'jQuery',
},
sourcemap: true,
banner: `/**
* ${pkg.projectName} v.${pkg.version} | under MIT license
* ${pkg.homepage}
*/`,
plugins: [
terser({
output: {
comments: (_node, { type, value }) => type === 'comment2' && /license/i.test(value),
},
}),
],
},
],
plugins: [
typescript({
tsconfig: './tsconfig.lib.json',
}),
],
},
{
input: './index.d.ts',
output: [{ file: 'build/jquery.syotimer.d.ts', format: 'es' }],
plugins: [dts()],
},
];