-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
106 lines (104 loc) · 1.76 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import typescript from "@rollup/plugin-typescript";
import terser from "@rollup/plugin-terser";
import dts from "rollup-plugin-dts";
import del from "rollup-plugin-delete";
import { nodeResolve } from '@rollup/plugin-node-resolve';
export default [
{
input: "src/SharedRequirePlugin.ts",
external: [
"webpack",
"webpack/lib/util/semver",
"webpack/lib/sharing/ProvideSharedPlugin",
"webpack/lib/RawModule"
],
output: [
{
file: "dist/webpack.esm.js",
format: "es"
},
{
file: "dist/webpack.cjs",
format: "cjs",
name: "sharedrequireplugin"
}
],
plugins: [
nodeResolve(),
typescript({
sourceMap: false
}),
//terser(), terser currently has a bug with modules: https://github.com/rollup/plugins/issues/1366
del({
targets: [
"dist"
],
hook: "buildStart"
})
]
},
{
input: "dist/dts/SharedRequirePlugin.d.ts",
output: {
file: "dist/webpack.d.ts",
format: "es"
},
plugins: [
dts({
compilerOptions: {
paths: {
"*": [
"dts/*"
]
}
}
})
]
},
{
input: "src/RollupPlugin.ts",
external: [
"rollup",
],
output: [
{
file: "dist/rollup.esm.js",
format: "es"
},
{
file: "dist/rollup.cjs.js",
format: "cjs",
name: "sharedrequireplugin"
}
],
plugins: [
nodeResolve(),
typescript({
sourceMap: false
}),
//terser(), terser currently has a bug with modules: https://github.com/rollup/plugins/issues/1366
]
},
{
input: "dist/dts/RollupPlugin.d.ts",
output: {
file: "dist/rollup.d.ts",
format: "es"
},
plugins: [
dts({
compilerOptions: {
paths: {
"*": [
"dts/*"
]
}
}
}),
del({
targets: "dist/dts/",
hook: "buildEnd"
})
]
}
];