Skip to content

lightscript/babel-plugin-lightscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-lightscript

Compiles LightScript to JavasScript when used with Babel.

The plugin only processes files that include .lsc or .lsx in their filenames.

It converts a "LightScript AST" produced by babylon-lightscript into a conventional "Babel AST".

If you are using ES7 features (like import), JSX, and Flow, use babel-preset-lightscript to target ES6 instead of using the plugin directly.

If you are using babel-plugin-lightscript with other plugins, be sure it is the first plugin.

Options

You may disable the standard library:

{
  "plugins": [
    ["lightscript", { "stdlib": false }]
  ]
}

Or disable its inclusion of lodash:

{
  "plugins": [
    ["lightscript", {
      "stdlib": {
        "lodash": false,
      }
    }]
  ]
}

Or tell it to use require() instead of import:

{
  "plugins": [
    ["lightscript", {
      "stdlib": {
        "require": true,
      }
    }]
  ]
}

Contributing

You will need to link babel-plugin-lightscript to itself:

cd babel-plugin-lightscript
npm link
npm link babel-plugin-lightscript
npm install
npm run build
npm test

Please report issues on the main lightscript repo instead of here.