diff --git a/rollup.config.js b/rollup.config.js index 804bba8..4c6ccad 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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(", "); + const config = { input: "src/index.js", external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)), @@ -10,7 +18,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: []