-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.lib.js
112 lines (107 loc) · 2.37 KB
/
rollup.config.lib.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
107
108
109
110
111
112
import * as p from "path";
import babel from "rollup-plugin-babel";
import nodeResolve from "rollup-plugin-node-resolve";
import commonjs from "rollup-plugin-commonjs";
const copyright = `/*
* Copyright (c) 2015 NFL
* Copyrights licensed under the MIT License.
* See the accompanying LICENSE file for terms.
*/
`;
const libOptions = {
banner: copyright,
exports: "named"
};
const plugins = [
babel({
babelrc: false,
presets: [
[
"env",
{
modules: false
}
],
"react"
],
plugins: [
"transform-object-rest-spread",
"transform-class-properties",
["transform-react-remove-prop-types", {removeImport: true}],
"external-helpers"
]
}),
nodeResolve({
jsnext: true
}),
commonjs({
sourcemap: true
})
];
const externals = [
"react",
"react-dom/server",
"deep-equal",
"object-assign",
"react-side-effect",
"prop-types"
];
export default [
{
input: p.resolve("src/Helmet.js"),
output: [
{
file: "lib/index.js",
format: "cjs",
...libOptions
},
{
file: "lib/index.es.js",
format: "es",
...libOptions
}
],
external: externals,
plugins
},
{
input: p.resolve("src/HelmetServerUtils.js"),
output: [
{
file: "lib/server.js",
format: "cjs",
...libOptions
},
{
file: "lib/server.es.js",
format: "es",
...libOptions
}
],
external: [
"react",
"react-dom/server",
"deep-equal",
"react-side-effect",
"prop-types"
],
plugins
},
{
input: p.resolve("src/CapUtils.js"),
output: [
{
file: "lib/capUtils.js",
format: "cjs",
...libOptions
},
{
file: "lib/capUtils.es.js",
format: "es",
...libOptions
}
],
external: externals,
plugins
}
];