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

babel-plugin-transform-ensure-ignore

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-transform-ensure-ignore

require.ensure ignore

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-transform-ensure-ignore

Build Status NPM Dependencies License

require.ensure is cool, but we don't need it in Node env.

see more https://webpack.github.io/docs/code-splitting.html#defining-a-split-point

this plugin will help to transform code below:

require.ensure([], (require) => {
  require.include('./some-module');
  require('./some-module');
});

to

require('./some-module');

Configure it in .babelrc for node, we could ignore the requirement when run test in node or build server render app. Then we run babel with BABEL_ENV=node will active this plugin;

{
  "env": {
    "node": {
      "plugins": [
        "babel-plugin-transform-ensure-ignore"
      ]
    }
  }
}

or use with babel-register in require-hooks

require('babel-register')({
  'plugins': [
     'babel-plugin-transform-ensure-ignore'
  ]
});

Or with cli like other plugin used.

Notice:

  • Don't use this in webpack system
  • make sure the correct usage of require.ensure

Keywords

FAQs

Package last updated on 05 Jan 2016

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