Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vanilla-icecream/rollup-plugin-asc
Compile AssemblyScript with Rollup.
https://github.com/vanilla-icecream/rollup-plugin-asc
assemblyscript rollup
Last synced: about 9 hours ago
JSON representation
Compile AssemblyScript with Rollup.
- Host: GitHub
- URL: https://github.com/vanilla-icecream/rollup-plugin-asc
- Owner: Vanilla-IceCream
- Created: 2020-11-16T02:11:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-16T11:48:46.000Z (over 2 years ago)
- Last Synced: 2024-04-24T19:11:54.393Z (7 months ago)
- Topics: assemblyscript, rollup
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rollup-plugin-asc [![Build Status](https://travis-ci.org/Vanilla-IceCream/rollup-plugin-asc.svg?branch=master)](https://travis-ci.org/Vanilla-IceCream/rollup-plugin-asc) [![Coverage Status](https://coveralls.io/repos/github/Vanilla-IceCream/rollup-plugin-asc/badge.svg?branch=master)](https://coveralls.io/github/Vanilla-IceCream/rollup-plugin-asc?branch=master)
Compile AssemblyScript with Rollup.
## Requirements
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.
## Install
Using npm:
```sh
$ npm i rollup-plugin-asc -D
```Using yarn:
```sh
$ yarn add rollup-plugin-asc -D
```## Usage
Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:
```js
import path from 'path';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import asc from 'rollup-plugin-asc';const file = '.ts';
export default {
input: path.join(__dirname, 'src', file),
output: {
file: path.join(__dirname, 'dist', file.substring(file.lastIndexOf('.'), 0) + '.js'),
format: 'cjs',
exports: 'auto',
},
external: ['fs', 'path', '@assemblyscript/loader', '@assemblyscript/loader/umd'],
plugins: [
resolve(),
commonjs(),
asc({ output: path.join(__dirname, 'dist') }),
],
};
```Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).
## Options
### `output`
Type: `string`
Default: `''`
Example: `output: path.join(__dirname, 'dist'),`### `args`
Type: `string[]`
Default: `[]`
Example: `args: ['--measure'],`The arguments that is passed straight to the [AssemblyScript compiler library](https://www.assemblyscript.org/compiler.html#command-line-options).
### `textFile`
Type: `boolean`
Default: `false`
Example: `textFile: true,`### `tsdFile`
Type: `boolean`
Default: `false`
Example: `tsdFile: true,`## Example
See the `example` [folder](./example).