forked from daybrush/moveable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
63 lines (61 loc) · 1.79 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
import builder from "@daybrush/builder";
import compat from "rollup-plugin-react-compat";
const compatPlugin = compat({
useReactCompat: true,
aliasModules: {
"react-moveable": "react-compat-moveable"
}
});
const resolveCompatPlugin = compat({
useReactCompat: true,
resolveCompat: true,
});
/*
"demo:start": "rollup -c rollup.config.demo.js -w",
"demo:build": "rm -rf ./demo/dist && rollup -c rollup.config.demo.js",
"prerelease": "npm run doc && npm run build && npm run demo:build && prerelease --dirs=dist,doc",
"release:before": "npm run build && npm run doc && npm run demo:build && npm run storybook",
*/
const external = {
"react-simple-compat": "react-simple-compat",
"react-compat-css-styled": "react-compat-css-styled",
"react-compat-moveable": "react-compat-moveable",
"@egjs/component": "@egjs/component",
"@daybrush/utils": "@daybrush/utils",
"gesto": "gesto",
"framework-utils": "framework-utils",
"@egjs/agent": "eg.Agent",
"@egjs/children-differ": "eg.ChildrenDiffer",
"css-styled": "css-styled"
};
export default builder([
{
name: "Moveable",
input: "src/index.umd.ts",
output: "./dist/moveable.js",
plugins: [resolveCompatPlugin],
},
{
name: "Moveable",
input: "src/index.umd.ts",
output: "./dist/moveable.min.js",
plugins: [resolveCompatPlugin],
uglify: true,
},
{
input: "src/index.ts",
output: "./dist/moveable.esm.js",
exports: "named",
format: "es",
plugins: [compatPlugin],
external,
},
{
input: "src/index.umd.ts",
output: "./dist/moveable.cjs.js",
exports: "default",
format: "cjs",
plugins: [compatPlugin],
external,
},
]);