Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-grommet

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-grommet

Babel plugin to transform member style imports into default imports

  • 0.5.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
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

Package last updated on 15 Jun 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc