Skip to content

Commit

Permalink
related d3/d3#3502; extract copyrights from LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jun 5, 2021
1 parent 38346a4 commit 9569bdb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import {readFileSync} from "fs";
import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";

// Extract copyrights from the LICENSE.
const copyright = readFileSync("./LICENSE", "utf-8")
.split(/\n/g)
.filter(line => /^Copyright\s+/.test(line))
.map(line => line.replace(/^Copyright\s+/, ""))
.join(", ");

function onwarn(message, warn) {
if (message.code === "CIRCULAR_DEPENDENCY") return;
warn(message);
Expand All @@ -15,7 +23,7 @@ const config = {
format: "umd",
indent: false,
extend: true,
banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`,
banner: `// ${meta.homepage} v${meta.version} Copyright ${copyright}`,
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"})))
},
plugins: [],
Expand Down

0 comments on commit 9569bdb

Please sign in to comment.