3 Star 15 Fork 6

Gitee 极速下载/d3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/d3/d3
克隆/下载
rollup.config.js 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
Mike Bostock 提交于 2022-12-20 15:58 . drop rollup-plugin-ascii
import {readFileSync} from "fs";
import json from "@rollup/plugin-json";
import nodeResolve from "@rollup/plugin-node-resolve";
import {terser} from "rollup-plugin-terser";
import meta from "./package.json" assert {type: "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: "bundle.js",
output: {
file: `dist/${meta.name}.js`,
name: "d3",
format: "umd",
indent: false,
extend: true,
banner: `// ${meta.homepage} v${meta.version} Copyright ${copyright}`
},
plugins: [
nodeResolve(),
json()
],
onwarn(message, warn) {
if (message.code === "CIRCULAR_DEPENDENCY") return;
warn(message);
}
};
export default [
config,
{
...config,
output: {
...config.output,
file: `dist/${meta.name}.min.js`
},
plugins: [
...config.plugins,
terser({
output: {
preamble: config.output.banner
},
mangle: {
reserved: [
"InternMap",
"InternSet"
]
}
})
]
}
];
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/d3.git
git@gitee.com:mirrors/d3.git
mirrors
d3
d3
v7.8.0

搜索帮助

0d507c66 1850385 C8b1a773 1850385