Socket
Socket
Sign inDemoInstall

babel-plugin-dynamic-import-node-sync

Package Overview
Dependencies
55
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

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


Version published
Maintainers
1
Install size
16.3 kB
Created

Readme

Source

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

Keywords

FAQs

Last updated on 03 Feb 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc