babel-plugin-global-assignment

1.0.1 • Public • Published

babel-plugin-global-assignment

A babel-plugin that translates global assignment statements into setting property statements for global objects.

Install

npm install --save-dev babel-plugin-global-assignment

Usage

Via .babelrc

{
  "plugins": [
    [
      "babel-plugin-global-assignment", {
        "globalObject": "window"
      }
    ]
  ]
}

Options

  • globalObject: Specify global object name.

Example

in

foo = true
function () {
  bar = true
  let baz = false
  baz = true
}

out

window.foo = true
function () {
  window.bar = true
  let baz = false
  baz = true
}

/babel-plugin-global-assignment/

    Package Sidebar

    Install

    npm i babel-plugin-global-assignment

    Weekly Downloads

    3

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    1.69 kB

    Total Files

    4

    Last publish

    Collaborators

    • forek