babel-plugin-dynamic-import-node-sync
Babel 7 plugin to transpile import() to a require(), for node
Last updated 8 years ago by zlatkofedor .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-plugin-dynamic-import-node-sync 
SYNC missed versions from official npm registry.

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

Via .babelrc (Recommended)

.babelrc

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

Via CLI

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

Current Tags

  • 2.0.1                                ...           latest (8 years ago)

2 Versions

  • 2.0.1                                ...           8 years ago
  • 1.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (1)
Dev Dependencies (17)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |