forked from fabricjs/fabric.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
47 lines (45 loc) · 1.22 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
46
47
import json from '@rollup/plugin-json';
import terser from '@rollup/plugin-terser';
import ts from '@rollup/plugin-typescript';
import { babel } from '@rollup/plugin-babel';
// import dts from "rollup-plugin-dts";
const splitter = /\n|\s|,/g;
// https://rollupjs.org/guide/en/#configuration-files
export default [
{
input: process.env.BUILD_INPUT?.split(splitter) || ['./index.ts'],
output: [
{
file: process.env.BUILD_OUTPUT || './dist/fabric.js',
name: 'fabric',
format: 'umd',
sourcemap: true,
},
Number(process.env.MINIFY)
? {
file: process.env.BUILD_MIN_OUTPUT || './dist/fabric.min.js',
name: 'fabric',
format: 'umd',
plugins: [terser()],
}
: null,
],
// see list of plugins (not comprehensive): https://github.com/rollup/awesome
plugins: [
json(),
ts({
noForceEmit: true,
tsconfig: './tsconfig.json',
}),
babel({
extensions: ['.ts', '.js'],
babelHelpers: 'bundled',
}),
],
},
// {
// input: "./my-input/index.d.ts",
// output: [{ file: "dist/my-library.d.ts", format: "es" }],
// plugins: [dts()],
// },
];