Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

babel-plugin-dynamic-import-node

Package Overview
Dependencies
1
Maintainers
9
Versions
12
Issues
File Explorer

Advanced tools

babel-plugin-dynamic-import-node

Babel plugin to transpile import() to a deferred require(), for node

    2.3.3latest

Version published
Maintainers
9
Weekly downloads
10,746,758
decreased by-20.24%

Weekly downloads

Changelog

Source

v2.3.3

  • [Fix] Generate webpack-compatible output with static string arg (#84)
  • [Fix] Handle visiting the same path gracefully (#71)

Readme

Source

babel-plugin-dynamic-import-node

Babel plugin to transpile import() to a deferred require(), for node. Matches the proposed spec.

NOTE: Babylon >= v6.12.0 is required to correctly parse dynamic imports.

Installation

npm install babel-plugin-dynamic-import-node --save-dev

Usage

.babelrc

{ "plugins": ["dynamic-import-node"] }
Options
  • noInterop - A boolean value, that if true will not interop the require calls. Useful to avoid using require('module').default on commonjs modules.
{ "plugins": [ ["dynamic-import-node", { "noInterop": true }] ] }

Via CLI

$ babel --plugins dynamic-import-node script.js

Via Node API

require('babel-core').transform('code', { plugins: ['dynamic-import-node'] });

Code Example

Promise.all([ import('./lib/import1'), import('./lib/import2') ]).then(([ Import1, Import2 ]) => { console.log(Import1); /* CODE HERE*/ });

Keywords

FAQs

What is babel-plugin-dynamic-import-node?

Babel plugin to transpile import() to a deferred require(), for node

Is babel-plugin-dynamic-import-node popular?

The npm package babel-plugin-dynamic-import-node receives a total of 8,987,616 weekly downloads. As such, babel-plugin-dynamic-import-node popularity was classified as popular.

Is babel-plugin-dynamic-import-node well maintained?

We found that babel-plugin-dynamic-import-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 9 open source maintainers collaborating on the project.

Last updated on 21 Apr 2020

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc