Socket
Socket
Sign inDemoInstall

babel-plugin-grommet

Package Overview
Dependencies
9
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-grommet

Babel plugin to transform member style imports into default imports


Version published
Weekly downloads
21
increased by162.5%
Maintainers
2
Install size
3.81 MB
Created
Weekly downloads
 

Readme

Source

babel-plugin-grommet

Babel plugin to convert member style imports to default imports.

:warning: Experimental: This plugin only works with Grommet Next (current branch for Grommet 2.0). DO NOT use this with Grommet 1.X.

Transforms this:

  import { Grommet, Button } from 'grommet';

into this:

  import Grommet from 'grommet/components/grommet';
  import Button from 'grommet/components/button';

Install

npm install babel-plugin-grommet --save-dev

or

yarn add babel-plugin-grommet --dev

Usage

Add the plugin to your .babelrc

{
  "plugins": ["grommet"]
}

Why?

Grommet Next already adds all the bits and pieces for tree shaking to work. But most module bundlers today still don't exclude the modules that are not being used. We tested our library against Webpack and RollUp and both of them include all components that are not being used just for the fact that it has been imported like this import { Button } from 'grommet'. This is why you need to use this plugin.

Keywords

FAQs

Last updated on 15 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc