Skip to content

Commit 93bc4ff

Browse files
committed
related d3/d3#3502; extract copyrights from LICENSE
1 parent 611e1c3 commit 93bc4ff

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rollup.config.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import {readFileSync} from "fs";
12
import {terser} from "rollup-plugin-terser";
23
import * as meta from "./package.json";
34

5+
// Extract copyrights from the LICENSE.
6+
const copyright = readFileSync("./LICENSE", "utf-8")
7+
.split(/\n/g)
8+
.filter(line => /^Copyright\s+/.test(line))
9+
.map(line => line.replace(/^Copyright\s+/, ""))
10+
.join(", ");
11+
412
const config = {
513
input: "src/index.js",
614
external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)),
@@ -10,7 +18,7 @@ const config = {
1018
format: "umd",
1119
indent: false,
1220
extend: true,
13-
banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`,
21+
banner: `// ${meta.homepage} v${meta.version} Copyright ${copyright}`,
1422
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"})))
1523
},
1624
plugins: []

0 commit comments

Comments
 (0)