-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathbuild.ts
More file actions
28 lines (25 loc) 路 697 Bytes
/
Copy pathbuild.ts
File metadata and controls
28 lines (25 loc) 路 697 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
import { rollup, OutputOptions, RollupOptions } from 'rollup';
import { default as terser } from '@rollup/plugin-terser';
// umd min
const umdMinInputOptions: RollupOptions = {
input: 'dist/module/umd_api.js',
plugins: [terser({sourceMap: true})],
};
const umdMinOutputOptions: OutputOptions = {
file: './dist/bundles/tinycolor.umd.min.js',
format: 'umd',
sourcemap: true,
name: 'tinycolor',
exports: 'default',
};
async function build() {
// create browser bundle
const umdMin = await rollup(umdMinInputOptions);
await umdMin.write(umdMinOutputOptions);
}
build()
.then(() => console.log('build success'))
.catch(e => {
console.error(e);
process.exit(1);
});