babel-plugin-transform-cjs-system-require
Transforms all calls of `require` into calls of the SystemJS internal `$__require`.
Last updated 9 years ago by guybedford .
MIT · Repository · Bugs · Original npm
$ cnpm install babel-plugin-transform-cjs-system-require 
SYNC missed versions from official npm registry.

babel-plugin-transform-cjs-system-require

Transforms all calls of require into calls of the SystemJS internal $__require.

Example

In

require('test/');

Out

$__require('test');

Installation

$ npm install babel-plugin-transform-cjs-system-require

Usage

Via .babelrc

.babelrc

{
  "plugins": [
    ["transform-cjs-system-require", {}]
  ]
}

Via CLI

$ babel --plugins transform-cjs-system-require script.js

Via Node API (Recommended)

require("babel-core").transform("code", {
  plugins: [
    ["transform-cjs-system-require", {
      requireName: "require", // optional
      mappedRequireName: "$__require", // optional
      map: function(name) { // optional
        return normalize(name);
      }
    }]
  ]
});

Current Tags

  • 0.1.1                                ...           latest (9 years ago)

1 Versions

  • 0.1.1                                ...           9 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org