Skip to content
Permalink
Browse files

Add custom build

  • Loading branch information
pc035860 committed Dec 19, 2019
1 parent 1126611 commit 62e2a41baca5f61be4191a41eb1c0e308934fdec
Showing with 83 additions and 1 deletion.
  1. +21 −0 custom.js
  2. +2 −1 package.json
  3. +52 −0 rollup-custom.config.js
  4. +8 −0 yarn.lock
@@ -0,0 +1,21 @@
export { version } from "./dist/package.js";

export { select, selectAll } from "d3-selection";

export * from "d3-selection-multi";
export { transition } from "d3-transition";

export {
easeElasticOut,
easeSinOut,
easeBackOut,
easeLinear,
easeCubicOut,
easeExpOut
} from "d3-ease";

export { arc, pie } from "d3-shape";

export { entries } from "d3-collection";

export { interpolate, interpolateNumber } from "d3-interpolate";
@@ -28,7 +28,7 @@
"index.js"
],
"scripts": {
"pretest": "rimraf dist && mkdir dist && json2module package.json > dist/package.js && rollup -c",
"pretest": "rimraf dist && mkdir dist && json2module package.json > dist/package.js && rollup -c && rollup -c rollup-custom.config.js",
"test": "tape 'test/**/*-test.js'",
"prepublishOnly": "yarn test",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3/dist/d3.js d3.v5.js && cp ../d3/dist/d3.min.js d3.v5.min.js && git add d3.v5.js d3.v5.min.js && git commit -m \"d3 ${npm_package_version}\" && git push && cd - && cd ../d3-bower && git pull && cp ../d3/LICENSE ../d3/README.md ../d3/dist/d3.js ../d3/dist/d3.min.js . && git add -- LICENSE README.md d3.js d3.min.js && git commit -m \"${npm_package_version}\" && git tag -am \"${npm_package_version}\" v${npm_package_version} && git push && git push --tags && cd - && zip -j dist/d3.zip -- LICENSE README.md API.md CHANGES.md dist/d3.js dist/d3.min.js"
@@ -67,6 +67,7 @@
"d3-scale": "2",
"d3-scale-chromatic": "1",
"d3-selection": "1",
"d3-selection-multi": "^1.0.1",
"d3-shape": "1",
"d3-time": "1",
"d3-time-format": "2",
@@ -0,0 +1,52 @@
import ascii from "rollup-plugin-ascii";
import node from "rollup-plugin-node-resolve";
import { terser } from "rollup-plugin-terser";
import * as meta from "./package.json";

const copyright = `// ${meta.homepage} v${
meta.version
} Copyright ${new Date().getFullYear()} ${meta.author.name}`;

function onwarn(message, warn) {
if (message.code === "CIRCULAR_DEPENDENCY") return;
warn(message);
}

export default [
{
input: "index.js",
external: Object.keys(meta.dependencies || {}).filter(key =>
/^d3-/.test(key)
),
output: {
file: "dist/d3-custom.node.js",
format: "cjs"
},
onwarn
},
{
input: "custom.js",
plugins: [node(), ascii()],
output: {
extend: true,
banner: copyright,
file: "dist/d3-custom.js",
format: "umd",
indent: false,
name: "d3"
},
onwarn
},
{
input: "custom.js",
plugins: [node(), ascii(), terser({ output: { preamble: copyright } })],
output: {
extend: true,
file: "dist/d3-custom.min.js",
format: "umd",
indent: false,
name: "d3"
},
onwarn
}
];
@@ -263,6 +263,14 @@ d3-scale@2:
d3-time "1"
d3-time-format "2"

d3-selection-multi@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/d3-selection-multi/-/d3-selection-multi-1.0.1.tgz#cd6c25413d04a2cb97470e786f2cd877f3e34f58"
integrity sha1-zWwlQT0EosuXRw54byzYd/PjT1g=
dependencies:
d3-selection "1"
d3-transition "1"

d3-selection@1, d3-selection@^1.1.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/d3-selection/-/d3-selection-1.4.1.tgz#98eedbbe085fbda5bafa2f9e3f3a2f4d7d622a98"

0 comments on commit 62e2a41

Please sign in to comment.
You can’t perform that action at this time.