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

babel-plugin-lodash-legacy

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-lodash-legacy

Lodash modularized builds without the hassle (for babel5)

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-lodash-legacy Build Status

The goal of this package is to be an alternative/augmentation of lodash-modularize which is designed with slightly different goals.

This plugin is a simple transform to remove unused lodash code, without forcing the user to cherry pick methods manually. This lets you use lodash naturally (aka as documented) without worrying about bundling parts you're not using.

Deprecated

babel5 is no longer officially supported. This plugin is for the rare few who are still on babel5 but have yet to (and should) update to latest. Use at your own risk!

Example

Converts

import lodash from 'lodash';

lodash.map([1, 2, 3], function(x) {
    // ...
});

(roughly) to

import _map from 'lodash/collection/map';

_map([1, 2, 3], function(x) {
    // ...
});

FAQ

Where's my npm module support?

It will be implemented when plugins can support options (babel/babel#1833).

For now use lodash-modularize.

Do import specifiers work (import {x} from 'lodash')

You know it! You can also use both specifiers and direct imports (import _, {y} from 'lodash').

What about lodash-fp?

We've got ya covered (#3).

Limitations
  • You must be using ES6 imports to load lodash.

  • Chaining syntax is not supported

Usage
{
  "plugins": ["lodash"]
}
Via CLI
$ babel --plugins lodash script.js
Via Node API
require("babel-core").transform("code", {
  plugins: ["lodash"]
});

Keywords

FAQs

Package last updated on 19 Apr 2017

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