d3-bundler

A Rollup-based bundler for D3 modules.

use rollup/rollup
Last updated 4 years ago by mbostock .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install d3-bundler 
SYNC missed versions from official npm registry.

d3-bundler

A Rollup-based bundler for D3 modules.

To install:

npm install -g d3-bundler

To use, define an ES6 module that imports the D3 code you need and defines the corresponding exports. For example, try this index.js:

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

Make sure you have the desired D3 modules installed:

npm install d3-selection

Build your bundle:

d3-bundler -o d3.js -- index.js

Or, minified:

npm install -g uglify-js
d3-bundler -o d3.js -- index.js && uglifyjs -c -m -o d3.min.js -- d3.js

Have a nice day!

<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="d3.js"></script>
<script>

d3.select("body").append("h1").text("Hello, world!");

</script>

Command Line Reference

d3-bundler [options] -- [file]

The input file should be an ES6 module that defines your exports. See the examples. If not specified, it defaults to “index.js”.

Options:

  • --output, -o [default: "-"]

Specify the path to the generated bundle file. Use “-” for stdout.

  • --name, -n [default: "d3"]

Specify the name of the output module. This determines the name of the exported global in certain output formats.

  • --external, -x [default: false]

If true, keep external dependencies external. This enables the -f option, and is useful if you want to generate a CommonJS build or use a different bundler.

  • --format, -f [default: "umd"]

Specify the output format of the generated JavaScript. See Rollup for supported values. This can only be used when inlining external dependencies (i.e., without -x).

Current Tags

  • 0.4.2                                ...           latest (4 years ago)

16 Versions

  • 0.4.2 [deprecated]           ...           4 years ago
  • 0.4.1 [deprecated]           ...           4 years ago
  • 0.4.0 [deprecated]           ...           4 years ago
  • 0.3.0 [deprecated]           ...           4 years ago
  • 0.2.9 [deprecated]           ...           4 years ago
  • 0.2.7 [deprecated]           ...           4 years ago
  • 0.2.6 [deprecated]           ...           4 years ago
  • 0.2.5 [deprecated]           ...           4 years ago
  • 0.2.4 [deprecated]           ...           4 years ago
  • 0.2.3 [deprecated]           ...           4 years ago
  • 0.2.2 [deprecated]           ...           4 years ago
  • 0.2.1 [deprecated]           ...           4 years ago
  • 0.2.0 [deprecated]           ...           4 years ago
  • 0.1.1 [deprecated]           ...           4 years ago
  • 0.1.0 [deprecated]           ...           4 years ago
  • 0.0.1 [deprecated]           ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 2
Last Month 48
Dependencies (3)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |