Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ceifa/rollup-plugin-lua


https://github.com/ceifa/rollup-plugin-lua

Last synced: 18 days ago
JSON representation

Awesome Lists containing this project

README

        

# rollup-plugin-lua [![npm package](https://img.shields.io/npm/v/rollup-plugin-lua.svg)](https://www.npmjs.com/package/rollup-plugin-lua)

Rollup plugin for Lua scripts.

## Installation

```bash
npm install --save-dev rollup-plugin-lua
```

## Usage

### rollup.config.js
```js
import { rollup } from 'rollup';
import lua from 'rollup-plugin-lua';

rollup({
entry: 'src/app.js',
plugins: [
lua()
]
});
```

### sum.lua
```lua
return function(x, y)
return x + y
end
```

### app.js
```js
import run from './sum.lua';

const sum = await run();
console.log(sum(10, 10)); // 20
```