-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
rollup.config.js
35 lines (33 loc) · 996 Bytes
/
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
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
import resolve from "rollup-plugin-node-resolve"
import sourcemaps from "rollup-plugin-sourcemaps"
import replace from "rollup-plugin-replace"
const pkg = require("./package.json")
const deps = new Set(
["assert", "events", "path"].concat(Object.keys(pkg.dependencies))
)
export default {
input: ".temp/index.js",
output: {
file: "index.js",
format: "cjs",
sourcemap: true,
sourcemapFile: "index.js.map",
banner: `/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/`,
},
plugins: [
sourcemaps(),
resolve(),
replace({
"process.env.PACKAGE_VERSION": `"${pkg.version}"`,
}),
],
external: id => deps.has(id) || id.startsWith("lodash"),
}