-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathrollup.config.js
More file actions
44 lines (41 loc) · 863 Bytes
/
rollup.config.js
File metadata and controls
44 lines (41 loc) · 863 Bytes
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
import fs from 'node:fs/promises'
import terser from '@rollup/plugin-terser'
import pkg from './package.json' with { type: 'json' }
/**
* Clean build directory
* @param {string} path Path to clean
*/
const clean = (path) => ({
name: 'clean',
buildStart() {
fs.rm(path, {recursive: true, force: true})
},
})
const banner = `/*!
* Circle Progress - v${pkg.version} - ${new Date().toISOString().slice(0, 10)}
* ${pkg.homepage}
* Copyright (c) ${pkg.author.name}
* Licensed ${pkg.license}
*/`
/**
* @type {import('rollup').RollupOptions}
*/
export default {
input: 'src/circle-progress.js',
plugins: [clean('dist')],
output: [
{
file: 'dist/circle-progress.js',
format: 'es',
sourcemap: true,
banner,
},
{
file: 'dist/circle-progress.min.js',
format: 'es',
sourcemap: true,
banner,
plugins: [terser()],
},
]
}