npm.io
0.7.0 • Published 10 months ago

@talend/babel-plugin-import-d3

Licence
Apache-2.0
Version
0.7.0
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
160

@talend/babel-plugin-import-d3

This module is a babel plugin that transform imports from d3-shape and other d3 internal plugins, into imports from d3.

Before

import { select, event } from 'd3-selection';
import { arc as foo, pie } from 'd3-shape';
import { scaleBand } from 'd3-scale';
import { csv } from 'd3-fetch'`,

After

import { select, event, arc as foo, pie, scaleBand, csv } from 'd3';`,

How to use

Installation

npm i --dev @talend/babel-plugin-import-d3
yarn add -D @talend/babel-plugin-import-d3

Configuration

// .babelrc.json
{
	"plugins": ["@talend/babel-plugin-import-d3"]
}