📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

babel-plugin-dynamic-import-node-sync

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-dynamic-import-node-sync

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

2.0.1
latest
Version published
Weekly downloads
1.7K
-12.93%
Maintainers
1
Weekly downloads
 
Created

babel-plugin-dynamic-import-node-sync

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

I am using it for server-side rendering.

Difference from babel-plugin-dynamic-import-node

babel-plugin-dynamic-import-node-sync

import(SOURCE) => require(SOURCE)

babel-plugin-dynamic-import-node

import(SOURCE) => Promise.resolve().then(() => require(SOURCE))

Installation

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

Usage

.babelrc

{
  "plugins": ["dynamic-import-node-sync"]
}

Via CLI

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

FAQs

Package last updated on 03 Feb 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