- Notifications
You must be signed in to change notification settings - Fork17
License
NotificationsYou must be signed in to change notification settings
recharts/babel-plugin-recharts
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A babel plugin help you import less Recharts modules.
$ npm i -D babel-plugin-recharts
The plugin automatically compilesrecharts
import, like this:
import{Line,Area,Pie,Treemap,Cell}from'recharts';
babel plugin will be parsed into:
"use strict";require("recharts/lib/polyfill.js");var_Line=_interopRequireDefault(require("recharts/lib/cartesian/Line.js"));var_Area=_interopRequireDefault(require("recharts/lib/cartesian/Area.js"));var_Treemap=_interopRequireDefault(require("recharts/lib/chart/Treemap.js"));var_Pie=_interopRequireDefault(require("recharts/lib/polar/Pie.js"));var_Cell=_interopRequireDefault(require("recharts/lib/component/Cell.js"));var_recharts=_interopRequireDefault(require("recharts"));function_interopRequireDefault(obj){returnobj&&obj.__esModule ?obj :{default:obj};}
Hence you end up loading less modules.
You can choose toeither edit your custom Babel configurationor your Webpack configuration.Both options work..
{"plugins":["recharts"]...}
'module':{'loaders':[{'loader':'babel-loader','test':/\.js$/,'exclude':/node_modules/,'query':{'plugins':['recharts'], ...}}]}
- You must use ES2015 imports to load recharts
Copyright (c) 2015-2021 Recharts Group
About
No description or website provided.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors9
Uh oh!
There was an error while loading.Please reload this page.