babel-plugin-transform-global-system-wrapper

WebJar for babel-plugin-transform-global-system-wrapper

License

License

MIT
Categories

Categories

ORM Data
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

babel-plugin-transform-global-system-wrapper
Last Version

Last Version

0.3.4
Release Date

Release Date

Type

Type

jar
Description

Description

babel-plugin-transform-global-system-wrapper
WebJar for babel-plugin-transform-global-system-wrapper
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/systemjs/babel-plugin-transform-global-system-wrapper

Download babel-plugin-transform-global-system-wrapper

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/babel-plugin-transform-global-system-wrapper/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>babel-plugin-transform-global-system-wrapper</artifactId>
    <version>0.3.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/babel-plugin-transform-global-system-wrapper/
implementation 'org.webjars.npm:babel-plugin-transform-global-system-wrapper:0.3.4'
// https://jarcasting.com/artifacts/org.webjars.npm/babel-plugin-transform-global-system-wrapper/
implementation ("org.webjars.npm:babel-plugin-transform-global-system-wrapper:0.3.4")
'org.webjars.npm:babel-plugin-transform-global-system-wrapper:jar:0.3.4'
<dependency org="org.webjars.npm" name="babel-plugin-transform-global-system-wrapper" rev="0.3.4">
  <artifact name="babel-plugin-transform-global-system-wrapper" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='babel-plugin-transform-global-system-wrapper', version='0.3.4')
)
libraryDependencies += "org.webjars.npm" % "babel-plugin-transform-global-system-wrapper" % "0.3.4"
[org.webjars.npm/babel-plugin-transform-global-system-wrapper "0.3.4"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : babel-template jar [6.9.0,7)

Project Modules

There are no modules declared in this project.

babel-plugin-transform-global-system-wrapper

Converts global scripts into named System.registerDynamic('name', [], ...

Example

In

foo = "bar";

Out

System.registerDynamic("foo", [], false, function ($__require, $__exports, $__module) {
  var _retrieveGlobal = System.registry.get("@@global-helpers").prepareGlobal($__module.id, "foo", null);

  (function ($__global) {
    foo = "bar";
  })(this);

  return _retrieveGlobal();
});

Installation

$ npm install babel-plugin-transform-global-system-wrapper

Usage

Via .babelrc

.babelrc

{
  "plugins": [
    ["transform-global-system-wrapper", {
      "deps": ["baz.js"],
      "exportName": "foo",
      "globals": {
        "jquery": "jquery.js"
      },
      "moduleName": "foo",
      "systemGlobal": "SystemJS"
    }]
  ]
}

Via CLI

$ babel --plugins transform-global-system-wrapper script.js

Via Node API (Recommended)

require("babel-core").transform("code", {
  plugins: [
    ["transform-global-system-wrapper", {
      deps: ["baz.js"],
      exportName: "foo",
      globals: {
        "jquery": "jquery.js"
      },
      moduleName: "foo",
      systemGlobal: "SystemJS",
      esModule: true
    }]
  ]
});

Versions

Version
0.3.4