open-index/open-npm huggingface dataset:
npm package: @rollo-canela/first-nightly.js
Description: New Features: Calc, sayHello
Author: rollo-canela
Latest version: 1.0.3

# First.js 

First.js is a Javascript Library for printing messages by installing a package,

## Installation
Create a diretory name FirstProve
do `cd FirstProve`
Nextly init a npm repository by `npm init`
Set main to index.js
Do `npm i -D @rollo-canela/first.js`

## Usage

Inside of FirstProve, create a file named index.js, nextly in that file insert the following code

`const First = require('@rollo-canela/first.js');`

`let first-msg = new First();`
 
`first-msg.text("Put here your text")`

To run execute `node index.js`
npm package: @rollo-canela/first.js
Description: First.js is a javascript library for printing messages with a prebuild hello world
Author: rollo-canela
Latest version: 1.0.3

# First.js 

First.js is a Javascript Library for printing messages by installing a package,

## Installation
Create a diretory name FirstProve
do `cd FirstProve`
Nextly init a npm repository by `npm init`
Set main to index.js
Do `npm i -D @rollo-canela/first.js`

## Usage

Inside of FirstProve, create a file named index.js, nextly in that file insert the following code

`const First = require('@rollo-canela/first.js');`

`let first-msg = new First();`
 
`first-msg.text("Put here your text")`

To run execute `node index.js`
npm package: @rollstack/eslint-config
Description: ESLint config for Rollstack projects
Author: Rollstack Inc.
Latest version: 0.1.1

# @rollstack/eslint-config

ESLint config for Rollstack projects

[![npm version](https://img.shields.io/npm/v/@rollstack/eslint-config)](https://www.npmjs.com/package/@rollstack/eslint-config)

## Usage

Install as a dev dependency alongside ESLint and [predefined global variables](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables):

```sh
pnpm add -D @rollstack/eslint-config
pnpm add -D eslint globals
```

Set up ESLint with [presets documented below](#presets):

```js
// eslint.config.js
import baseConfig from "@rollstack/eslint-config/base";
import { defineConfig } from "eslint/config";
import globals from "globals";

export default defineConfig([
  { files: ["**/*.ts", "**/*.mts", "**/*.cts", "**/*.jsx", "**/*.tsx"] },
  { ignores: ["dist/"] },
  ...baseConfig,
  {
    languageOptions: {
      globals: {
        ...globals["shared-node-browser"],
      },
    },
  },
]);
```

If using TypeScript, consider adopting [`@total-typescript/tsconfig`](https://github.com/total-typescript/tsconfig) or:

- Enable [`strictNullChecks`](https://www.typescriptlang.org/tsconfig/#strictNullChecks) or the broader [`strict`](https://www.typescriptlang.org/tsconfig/#strict) compiler option
- Set [`module`](https://www.typescriptlang.org/tsconfig/#module) to `Preserve` or `NodeNext`, as package entry points may fail to resolve otherwise

### Presets

- `base` — JS + TS, no framework-specific rules, typed linting via [project service](https://typescript-eslint.io/troubleshooting/typed-linting/#project-service-issues)
npm package: @rolltrax/bs-number-to-words
Description: Hello! This project allows you to quickly get started with Reason and BuckleScript. If you wanted a more sophisticated version, try the `react` template (`bsb -theme react -init .`).
Author: Zach Baylin
Latest version: 1.0.0

# Basic Reason Template

Hello! This project allows you to quickly get started with Reason and BuckleScript. If you wanted a more sophisticated version, try the `react` template (`bsb -theme react -init .`).

# Build
```
npm run build
```

# Build + Watch

```
npm run start
```


# Editor
If you use `vscode`, Press `Windows + Shift + B` it will build automatically
npm package: @rolltrax/bs-react-dates
Description: Reason bindings for react-dates
Author: Rolltrax
Latest version: 1.0.0

# Reason bindings for react-dates

[Reason](https://reasonml.github.io/) bindings for [react-dates](https://github.com/airbnb/react-dates).

## Status

🚧 Not everything is supported yet; Unstable; Doesn't follow semver; 🚧

Feel free to create an issue or PR.

## Installation, [npm](https://www.npmjs.com/package/@ahrefs/bs-react-dates)

```sh
npm install --save @ahrefs/bs-react-dates
```

Then add `@ahrefs/bs-react-dates` to `bs-dependencies` in your `bsconfig.json`:

```js
{
  ...
  "bs-dependencies": ["@ahrefs/bs-react-dates"]
}
```

To include styles

```js
[%bs.raw {|require('react-dates/lib/css/_datepicker.css')|}];
```

`react-dates` [assumes](https://github.com/airbnb/react-dates/issues/798) that `box-sizing: border-box` is set globally in your page's CSS. At least do this, to make it display properly.

```css
.DateRangePicker *,
.SingleDatePicker *,
.DayPickerRangeController * {
  box-sizing: border-box;
}
```

## TODO

* [x] [DateRangePicker](https://github.com/airbnb/react-dates#daterangepicker)
* [x] [SingleDatePicker](https://github.com/airbnb/react-dates#singledatepicker)
* [ ] [DayPickerRangeController](https://github.com/airbnb/react-dates#daypickerrangecontroller)
* [ ] can I/should I make it independable from `bs-moment`?

## Usage

Please take a look at [examples](https://github.com/ahrefs/bs-react-dates/tree/master/examples).
To run demo:

```sh
$ cd examples
$ npm install
$ npm start
```
npm package: @rolltrax/bs-react-table
Description: React Table for Reason
Author: Zach Baylin
Latest version: 2.0.0

# bs-react-table

Bucklescript/Reason bindings for [react-table](https://github.com/react-tools/react-table)

## Info

🚧 This is a WIP library. Most of the basic features are implemented, but some are still left not working. If you would like to help with the development effort, feel free to submit a pull request 🚧

This library provides Bucklescript bindings for [react-table](https://github.com/react-tools/react-table)


## Installation

```bash
npm install --save bs-react-table
```

Then add it to your `bs-dependencies` in your `bsconfig.json`:

```json
{
  ...
  "bs-dev-dependencies": ["bs-react-table"]
}
```

And then add this to your header in your html template :

```html
<link rel="stylesheet" href="https://unpkg.com/react-table@latest/react-table.css">
```

## Usage

Usage is very similar to the original package

```reason
let columns = [|
  {"Header": "Name", "accessor": "name"},
  {"Header": "Age", "accessor": "age"},
|];

let data = [|
  {"name": "thomas", "age": "25"},
  {"name": "aude", "age": "23"},
  {"name": "damien", "age": "32"},
|];

let make = _children => {
  ...component,
  render: self => <ReactTable.ReactTable columns data label=(Some("test")) />,
};
```
npm package: @rolludejo/internal-build-utils
Description: 本 repo 容纳 rolludejo 下属项目[^1]&#x200B;**构建方面**的共用代码。
Author: Umaĵo
Latest version: 0.1.2

# @rolludejo/internal-build-utils

本 repo 容纳 rolludejo 下属项目[^1]&#x200B;**构建方面**的共用代码。

> [!WARNING]
>
> 本 repo 只对 rolludejo 的下属项目负责，除此以外概不负责。

最初提取自 [dicexp monorepo](https://github.com/umajho/dicexp)
[此次 commit](https://github.com/umajho/dicexp/commit/91ec5a3d14f4d82648a7773d8a91156144df08bd)
下的 `internal/build-utils`。

[^1]: 如 dicexp、rotext。
npm package: @rolludejo/internal-web-shared
Description: 本 repo 主要容纳 rolludejo 的下属项目（如 dicexp、rotext）的共用代码。
Author: Umaĵo
Latest version: 0.4.1

# @rolludejo/internal-web-shared

本 repo 主要容纳 rolludejo 的下属项目（如 dicexp、rotext）的共用代码。

注意：本 repo 的存在仅为上述项目内部使用，并不会考虑除此以外的兼容性问题。

最初提取自 [rotext monorepo](https://github.com/umajho/rotext)
[此次 commit](https://github.com/umajho/rotext/commit/7702a2947377d8e317e864ff447a8244d459a528)
下的：

- `packages/solid-components`（前者作为基础模板，以及将部分代码从前者转移至此。）
- `internal/web-utils`（将部分代码从前者转移至此。）

---

如果要引入本包中涉及到 SolidJS 的功能（如 `ShadowRootAttacher`），需要配置
Vite（于 `vite.config.ts`）：

```typescript
// …

export default defineConfig({
  // …
  optimizeDeps: {
    exclude: ["@rolludejo/internal-web-shared"],
  },
  // …
});
```
npm package: @rolludejo/web-internal
Description: 本 repo 主要容纳 rolludejo 的下属项目（如 dicexp、rotext）的共用代码。
Author: Umaĵo
Latest version: 0.3.0
Deprecated: renamed as @rolludejo/internal-web-shared

# @rolludejo/web-internal

本 repo 主要容纳 rolludejo 的下属项目（如 dicexp、rotext）的共用代码。

注意：本 repo 的存在仅为上述项目内部使用，并不会考虑除此以外的兼容性问题。

最初提取自 [rotext monorepo](https://github.com/umajho/rotext)
[此次 commit](https://github.com/umajho/rotext/commit/7702a2947377d8e317e864ff447a8244d459a528)
下的：

- `packages/solid-components`（前者作为基础模板，以及将部分代码从前者转移至此。）
- `internal/web-utils`（将部分代码从前者转移至此。）
npm package: @rollup-umd/build
Description: CI build job
Author: Dimitri Kopriwa
Latest version: 1.1.1

# build

[![Build Status](https://travis-ci.org/rollup-umd/build.svg?branch=master)](https://travis-ci.org/rollup-umd/build)
[![npm Version](https://img.shields.io/npm/v/@rollup-umd/build.svg?style=flat)](https://www.npmjs.com/package/@rollup-umd/build)
[![License](https://img.shields.io/npm/l/@rollup-umd/build.svg?style=flat)](https://www.npmjs.com/package/@rollup-umd/build)
[![NPM monthly downloads](https://img.shields.io/npm/dm/@rollup-umd/build.svg?style=flat)](https://npmjs.org/package/@rollup-umd/build)
[![NPM total downloads](https://img.shields.io/npm/dt/@rollup-umd/build.svg?style=flat)](https://npmjs.org/package/@rollup-umd/build)
[![npm Version](https://img.shields.io/node/v/@rollup-umd/build.svg?style=flat)](https://www.npmjs.com/package/@rollup-umd/build)
[![Module formats](https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg?style=flat)](https://www.npmjs.com/package/@rollup-umd/build)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.github.rollup-umd.build&metric=coverage)](https://sonarcloud.io/dashboard?id=com.github.rollup-umd.build) [![Quality gate status](https://sonarcloud.io/api/project_badges/measure?project=com.github.rollup-umd.build&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.github.rollup-umd.build)


CI build job


## Table of Contents

  - [Documentation](#documentation)
  - [Contributing](#contributing)
  - [License MIT](#license-mit)

---

## Documentation

Read [build documentation](https://rollup-umd.github.io/build).


## Contributing

If you want to contribute to build please see our [contributing and community guidelines](https://github.com/rollup-umd/build/blob/master/.github/CONTRIBUTING.md), they\'ll help you get set up locally and explain the whole process.

Please also note that all repositories under the rollup-umd organization follow our [Code of Conduct](https://github.com/rollup-umd/build/blob/master/CODE_OF_CONDUCT.md), make sure to review and follow it.

## License MIT

Copyright 2019 Yeutech Company Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
npm package: @rollup-uncensored/sdk
Description: SDK for enhancing censorship resistance of L2 transactions
Latest version: 0.1.7

# Uncensored SDK

## Overview

Uncensored SDK is a powerful tool designed to enhance the censorship resistance of Layer 2 (L2) transactions. It enables users to transform L2 transactions into Layer 1 (L1) transaction format, allowing them to be sent directly to L1 RPCs. This bypasses potential censorship by L2 sequencers and leverages existing Force Inclusion mechanisms on various L2 chains.

## Features

- Transform L2 transactions to L1 format
- Utilize existing Force Inclusion mechanisms on supported L2 chains
- Easy integration with popular Ethereum libraries (ethers.js, viem)

## Installation

```bash
npm install uncensored-sdk
```

## Key Concepts

### Censorship Resistance

Censorship resistance is crucial for blockchain networks. While Ethereum's L1 achieves this through numerous validators, L2 solutions often rely on centralized sequencers, making them potentially vulnerable to censorship.

### Force Inclusion

Force Inclusion is a mechanism provided by some L2 networks that allows users to submit transactions directly to the L1 Rollup contract. Our SDK helps users leverage these existing mechanisms, ensuring L2 transactions can't be indefinitely censored by sequencers.

### Delayed Execution

To maintain consistency and prevent conflicts, forced transactions typically don't execute immediately on L2 networks. Instead, they enter a "pending" state, giving sequencers a chance to include them in the next batch. If a sequencer consistently refuses to include these transactions, they can be forcibly included after a set time period.

## Supported Networks

- [List of supported L2 networks and their corresponding L1]

## Usage

[Basic usage examples will be added here in future updates]

## Advanced Features

- Transaction status monitoring
- Automated Force Inclusion triggering
- Gas estimation for L1 force transactions

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for more details.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

If you encounter any issues or have questions, please file an issue on our GitHub repository.

---

By using Uncensored SDK, you're contributing to a more censorship-resistant and decentralized ecosystem. We believe in the power of open, accessible blockchain networks and are committed to providing tools that uphold these values.
npm package: @rollup-use/core
Description: A pure-js npm library bundle tool use rollup. 此工具使用 rollup, 可以打包纯 js 的 npm 库项目.
Latest version: 1.1.0

# `@rollup-use/core`

A pure-js npm library bundle tool use rollup. Clone [js-starter](../js-starter) to quick start.

此工具使用 rollup, 可以打包纯 js 的 npm 库项目. [中文文档](#zh). 可以复制 [js-starter](../js-starter) 以快速开始.

## Examples/用例列表

- [js-starter](../js-starter)

You can add your public repo here. 欢迎添加你的项目到这里.

## Usage

Install dependencies

```sh
npm install @rollup-use/core typescript --save-dev
npm install @babel/runtime -save
```

Copy directory `scripts` into your project. Add 2 npm scripts to `scripts` of `package.json` like follow:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

Check `scripts/build.ts` and change it for your requirement. In most case, you may only need to change `input`. Once `scripts/build.ts` changed, execute `npm run compile-build-lib` to generate `scripts/build.js`. Then execute `npm run build-lib` to generate the final results.

## Exclude core-js

Don't include core-js in your package.json, including `dependencies` and `devDependencies`. Or there will be `core-js` imports in your bundled results.

# 中文文档<a name="zh"></a>

## 使用

安装依赖

```sh
npm install @rollup-use/core typescript --save-dev
npm install @babel/runtime -save
```

复制目录 `scripts` 到你的项目. 参照如下, 添加 3 条 npm script 到`package.json`的`scripts`:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

按你的需求修改`scripts/build.ts`. 多数情况下你可能只需要修改`input`变量. 一旦`scripts/build.ts`有改动, 执行 `npm run compile-build-lib` 以生成 `scripts/build.js`. 再执行 `npm run build-lib` 即可生成最终结果.

## 排除 core-js

不要在 `package.json` 中包含 `core-js`, 包括 `dependencies` 和 `devDependencies`. 否则打包结果中会有 `core-js` 导入.
npm package: @rollup-use/ts
Description: A typescript npm library bundle tool use rollup. 使用 rollup 打包 typescript 语言的 npm 库项目.
Author: phphe
Latest version: 0.0.6

# `@rollup-use/ts`

A typescript npm library bundle tool use rollup. Clone [ts-starter](../ts-starter) to quick start.

此工具使用 rollup, 可以打包 typescript 语言的 npm 库项目. [中文文档](#zh). 可以复制 [ts-starter](../ts-starter) 以快速开始.

## Examples/用例列表

- [ts-starter](../ts-starter)
- [phphe/helper-js](https://github.com/phphe/helper-js)
- [phphe/draggable-helper](https://github.com/phphe/draggable-helper)

You can add your public repo here. 欢迎添加你的项目到这里.

## Usage

Install dependencies

```sh
npm install @rollup-use/core @rollup-use/ts typescript --save-dev
npm install @babel/runtime tslib -save
```

Copy directory `scripts` into your project. Add 2 npm scripts to `scripts` of `package.json` like follow:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

Check `scripts/build.ts` and change it for your requirement. In most case, you may only need to change `input`. Once `scripts/build.ts` changed, execute `npm run compile-build-lib` to generate `scripts/build.js`. Then execute `npm run build-lib` to generate the final results.

## Exclude core-js

Don't include core-js in your package.json, including `dependencies` and `devDependencies`. Or there will be `core-js` imports in your bundled results.

# 中文文档<a name="zh"></a>

## 使用

安装依赖

```sh
npm install @rollup-use/core @rollup-use/ts typescript --save-dev
npm install @babel/runtime tslib -save
```

复制目录 `scripts` 到你的项目. 参照如下, 添加 3 条 npm script 到`package.json`的`scripts`:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

按你的需求修改`scripts/build.ts`. 多数情况下你可能只需要修改`input`变量. 一旦`scripts/build.ts`有改动, 执行 `npm run compile-build-lib` 以生成 `scripts/build.js`. 再执行 `npm run build-lib` 即可生成最终结果.

## 排除 core-js

不要在 `package.json` 中包含 `core-js`, 包括 `dependencies` 和 `devDependencies`. 否则打包结果中会有 `core-js` 导入.
npm package: @rollup-use/vue2-js
Description: A `Vue2`+js npm library bundle tool use rollup. 使用 rollup打包纯js的 Vue2 npm 库项目.
Author: phphe
Latest version: 0.0.7

# `@rollup-use/vue2-js`

A `Vue2`+js npm library bundle tool use rollup. Clone [vue2-js-starter](../vue2-js-starter) to quick start.

此工具使用 rollup, 可以打包纯 js 的 `Vue2` npm 库项目. [中文文档](#zh). 可以复制 [vue2-js-starter](../vue2-js-starter) 以快速开始.

## Examples/用例列表

- [vue2-js-starter](../vue2-js-starter)

You can add your public repo here. 欢迎添加你的项目到这里.

## Usage

**Follow steps is tested in a project generated by Vue CLI.**

Install dependencies

```sh
npm install @rollup-use/core @rollup-use/vue2-js typescript --save-dev
npm install @babel/runtime vue-runtime-helpers -save
```

Add vue to `peerDependencies` of `package.json`.

```json
"peerDependencies": {
  "vue": "^2.*.*"
}
```

Create a entry file to export Vue components for rollup, such as `src/lib-entry.js` and with content like follow:

```js
export { default } from "./LibraryComponent.vue";
export { default as CustomName } from "./LibraryComponent2.vue";
export { default as CustomName3 } from "./LibraryComponent3.vue";
```

Can export multiple components. Can custom exported name.

Copy directory `scripts` into your project. Add 2 npm scripts to `scripts` of `package.json` like follow:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

Check `scripts/build.ts` and change it for your requirement. In most case, you may only need to change `input`. Once `scripts/build.ts` changed, execute `npm run compile-build-lib` to generate `scripts/build.js`. Then execute `npm run build-lib` to generate the final results.

## Exclude core-js

Don't include core-js in your package.json, including `dependencies` and `devDependencies`. Or there will be `core-js` imports in your bundled results.

# 中文文档<a name="zh"></a>

## 使用

**以下步骤在 Vue CLI 生成的项目中测试通过.**

安装依赖

```sh
npm install @rollup-use/core @rollup-use/vue2-js typescript --save-dev
npm install @babel/runtime vue-runtime-helpers -save
```

添加 vue 到 `package.json` 的 `peerDependencies`.

```json
"peerDependencies": {
  "vue": "^2.*.*"
}
```

创建打包的入口文件, 此文件导出 Vue 组件, 例 `src/lib-entry.js`, 示例内容如下:

```js
export { default } from "./LibraryComponent.vue";
export { default as CustomName } from "./LibraryComponent2.vue";
export { default as CustomName3 } from "./LibraryComponent3.vue";
```

可以导出多个组件, 导出时可以自定义导出名.

复制目录 `scripts` 到你的项目. 参照如下, 添加 3 条 npm script 到`package.json`的`scripts`:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

按你的需求修改`scripts/build.ts`. 多数情况下你可能只需要修改`input`变量. 一旦`scripts/build.ts`有改动, 执行 `npm run compile-build-lib` 以生成 `scripts/build.js`. 再执行 `npm run build-lib` 即可生成最终结果.

## 排除 core-js

不要在 `package.json` 中包含 `core-js`, 包括 `dependencies` 和 `devDependencies`. 否则打包结果中会有 `core-js` 导入.
npm package: @rollup-use/vue2-ts
Description: A `Vue2`+ `typescript` npm library bundle tool use rollup. 使用 rollup打包 typescript 语言的 Vue2 npm 库项目.
Author: phphe
Latest version: 0.0.6

# `@rollup-use/vue2-ts`

A `Vue2`+ `typescript` npm library bundle tool use rollup. Clone [vue2-ts-starter](../vue2-ts-starter) to quick start.

此工具使用 rollup, 可以打包 typescript 语言 的 `Vue2` npm 库项目. [中文文档](#zh). 可以复制 [vue2-ts-starter](../vue2-ts-starter) 以快速开始.

## Examples/用例列表

- [vue2-ts-starter](../vue2-ts-starter)
- [phphe/@he-tree/vue2](https://github.com/phphe/he-tree/tree/master/packages/vue2)

You can add your public repo here. 欢迎添加你的项目到这里.

## Usage

**Follow steps is tested in a project generated by Vue CLI.**

Install dependencies

```sh
npm install @rollup-use/core @rollup-use/vue2-ts --save-dev
npm install @babel/runtime vue-runtime-helpers tslib -save
```

Add vue to `peerDependencies` of `package.json`.

```json
"peerDependencies": {
  "vue": "^2.*.*"
}
```

Create a entry file to export Vue components for rollup, such as `src/lib-entry.js` and with content like follow:

```js
export { default } from "./LibraryComponent.vue";
export { default as CustomName } from "./LibraryComponent2.vue";
export { default as CustomName3 } from "./LibraryComponent3.vue";
```

Can export multiple components. Can custom exported name.

Copy directory `scripts` into your project. Add 2 npm scripts to `scripts` of `package.json` like follow:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

Check `scripts/build.ts` and change it for your requirement. In most case, you may only need to change `input`. Once `scripts/build.ts` changed, execute `npm run compile-build-lib` to generate `scripts/build.js`. Then execute `npm run build-lib` to generate the final results.

## Exclude core-js

Don't include core-js in your package.json, including `dependencies` and `devDependencies`. Or there will be `core-js` imports in your bundled results.

# 中文文档<a name="zh"></a>

## 使用

**以下步骤在 Vue CLI 生成的项目中测试通过.**

安装依赖

```sh
npm install @rollup-use/core @rollup-use/vue2-ts --save-dev
npm install @babel/runtime vue-runtime-helpers tslib -save
```

添加 vue 到 `package.json` 的 `peerDependencies`.

```json
"peerDependencies": {
  "vue": "^2.*.*"
}
```

创建打包的入口文件, 此文件导出 Vue 组件, 例 `src/lib-entry.js`, 示例内容如下:

```js
export { default } from "./LibraryComponent.vue";
export { default as CustomName } from "./LibraryComponent2.vue";
export { default as CustomName3 } from "./LibraryComponent3.vue";
```

可以导出多个组件, 导出时可以自定义导出名.

复制目录 `scripts` 到你的项目. 参照如下, 添加 3 条 npm script 到`package.json`的`scripts`:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

按你的需求修改`scripts/build.ts`. 多数情况下你可能只需要修改`input`变量. 一旦`scripts/build.ts`有改动, 执行 `npm run compile-build-lib` 以生成 `scripts/build.js`. 再执行 `npm run build-lib` 即可生成最终结果.

## 排除 core-js

不要在 `package.json` 中包含 `core-js`, 包括 `dependencies` 和 `devDependencies`. 否则打包结果中会有 `core-js` 导入.
npm package: @rollup-use/vue3-ts
Description: A `Vue3`+ `typescript` npm library bundle tool use rollup. 使用 rollup打包 typescript 语言的 Vue3 npm 库项目.
Author: phphe
Latest version: 0.0.5

# `@rollup-use/vue3-ts`

A `Vue3`+ `typescript` npm library bundle tool use rollup. Clone [vue3-ts-starter](../vue3-ts-starter) to quick start.

此工具使用 rollup, 可以打包 typescript 语言 的 `Vue3` npm 库项目. [中文文档](#zh). 可以复制 [vue3-ts-starter](../vue3-ts-starter) 以快速开始.

## Examples/用例列表

- [vue3-ts-starter](../vue3-ts-starter)
- [phphe/@he-tree/vue3](https://github.com/phphe/he-tree/tree/master/packages/vue3)

You can add your public repo here. 欢迎添加你的项目到这里.

## Usage

**Follow steps is tested in a project generated by Vite CLI. Example CMD: `yarn create vite my-vue-app --template vue-ts`**

Install dependencies

```sh
npm install @rollup-use/core @rollup-use/vue3-ts --save-dev
npm install @babel/runtime tslib -save
```

Add vue to `peerDependencies` of `package.json`.

```json
"peerDependencies": {
  "vue": "^3.*.*"
}
```

Create a entry file to export Vue components for rollup, such as `src/lib-entry.js` and with content like follow:

```js
export { default } from "./LibraryComponent.vue";
export { default as CustomName } from "./LibraryComponent2.vue";
export { default as CustomName3 } from "./LibraryComponent3.vue";
```

Can export multiple components. Can custom exported name.

Copy directory `scripts` into your project. Add 2 npm scripts to `scripts` of `package.json` like follow:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

Check `scripts/build.ts` and change it for your requirement. In most case, you may only need to change `input`. Once `scripts/build.ts` changed, execute `npm run compile-build-lib` to generate `scripts/build.js`. Then execute `npm run build-lib` to generate the final results.

## Exclude core-js

Don't include core-js in your package.json, including `dependencies` and `devDependencies`. Or there will be `core-js` imports in your bundled results.

# 中文文档<a name="zh"></a>

## 使用

**以下步骤在 Vue CLI 生成的项目中测试通过.**

安装依赖

```sh
npm install @rollup-use/core @rollup-use/vue3-ts --save-dev
npm install @babel/runtime tslib -save
```

添加 vue 到 `package.json` 的 `peerDependencies`.

```json
"peerDependencies": {
  "vue": "^3.*.*"
}
```

创建打包的入口文件, 此文件导出 Vue 组件, 例 `src/lib-entry.js`, 示例内容如下:

```js
export { default } from "./LibraryComponent.vue";
export { default as CustomName } from "./LibraryComponent2.vue";
export { default as CustomName3 } from "./LibraryComponent3.vue";
```

可以导出多个组件, 导出时可以自定义导出名.

复制目录 `scripts` 到你的项目. 参照如下, 添加 3 条 npm script 到`package.json`的`scripts`:

```json
"scripts": {
  "build-lib": "rollup -c scripts/build.js & node scripts/build.js --report",
  "watch-lib": "rollup -c scripts/build.js --watch"
}
```

按你的需求修改`scripts/build.ts`. 多数情况下你可能只需要修改`input`变量. 一旦`scripts/build.ts`有改动, 执行 `npm run compile-build-lib` 以生成 `scripts/build.js`. 再执行 `npm run build-lib` 即可生成最终结果.

## 排除 core-js

不要在 `package.json` 中包含 `core-js`, 包括 `dependencies` 和 `devDependencies`. 否则打包结果中会有 `core-js` 导入.
npm package: @rollup/plugin-auto-install
Description: Automatically install dependencies that are imported by a bundle
Author: Rich Harris
Latest version: 3.0.5

[npm]: https://img.shields.io/npm/v/@rollup/plugin-auto-install
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-auto-install
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-auto-install
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-auto-install

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-auto-install

🍣 A Rollup plugin which automatically installs dependencies that are imported by a bundle, even if not yet in `package.json`.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-auto-install --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import auto from '@rollup/plugin-auto-install';
import resolve from '@rollup/plugin-node-resolve';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [auto(), resolve()]
};
```

_Note: ensure that this plugin is added to the `plugins` array *before* [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve)._

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

### `pkgFile`

Type: `String`<br>
Default: `'{cwd}/package.json'`

Specifies the location on disk of the target `package.json` file. If the file doesn't exist, it will be created by the plugin, as package managers need to populate the `dependencies` property.

### `manager`

Type: `'pnpm'|'yarn'|'npm'`<br>
Default: determined at runtime

Specifies the package manager to use. If not specified:

- `'pnpm'` if `pnpm-lock.yaml` exists
- `'yarn'` if `yarn.lock` exists
- `'npm'` otherwise

## Credits

Thanks to [Guillermo Rauch](https://twitter.com/rauchg) for the idea.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-beep
Description: A Rollup plugin which beeps on errors and warnings
Author: shellscape
Latest version: 1.0.3

[npm]: https://img.shields.io/npm/v/@rollup/plugin-beep
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-beep
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-beep
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-beep

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-beep

🍣 A Rollup plugin that beeps when a build ends with errors.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-beep --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
const beep = require('@rollup/plugin-beep');

module.exports = {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [beep()]
};
```

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). If the build produces any errors, the plugin will write a "beep" character to stderr, which should be audible on most systems.

## Options

This plugin currently has no available options.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-buble
Description: Compile ES2015 with buble
Author: Rich Harris
Latest version: 1.0.3

[npm]: https://img.shields.io/npm/v/@rollup/plugin-buble
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-buble
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-buble
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-buble

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-buble

🍣 A Rollup plugin which converts ES2015+ code with the Bublé compiler.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-buble --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import buble from '@rollup/plugin-buble';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [buble()]
};
```

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

### `transforms`

Type: `Object`<br>
Default: `{ modules: false }`

Specifies additional [transform options](https://buble.surge.sh/guide/) for the Bublé compiler.

### `exclude`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-data-uri
Description: Import modules from Data URIs
Author: shellscape
Latest version: 1.0.3

[npm]: https://img.shields.io/npm/v/@rollup/plugin-data-uri
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-data-uri
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-data-uri
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-data-uri

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-data-uri

🍣 A Rollup plugin which imports modules from Data URIs.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-data-uri --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import dataUri from '@rollup/plugin-data-uri';

module.exports = {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [dataUri()]
};
```

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). If the build produces any errors, the plugin will write a "data-uri" character to stderr, which should be audible on most systems.

## Options

This plugin currently has no available options.

## Supported MIME Types

The following MIME types are supported by this plugin:

- `text/javascript`
- `application/json`

This mirrors support in the [latest version of Node.js](https://nodejs.org/api/esm.html#esm_data_imports), with the exception of WebAssembly support.

## Base64 Encoding

Base64 encoding is supported for well-formed `data:` URIs. For example:

```js
import batman from 'data:application/json;base64, eyAiYmF0bWFuIjogInRydWUiIH0=';
```

## Dynamic Imports

Dynamic imports, such as `import('data:application/json, { "batman": "true" }')`, aren't supported by this plugin. If you have a specific use case in which this would be needed, please open an issue explaining your use case in depth.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-dsv
Description: Convert .csv and .tsv files into JavaScript modules with d3-dsv
Author: Rich Harris
Latest version: 3.0.5

[npm]: https://img.shields.io/npm/v/@rollup/plugin-dsv
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-dsv
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-dsv
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-dsv

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-dsv

🍣 A Rollup plugin which converts `.csv` and `.tsv` files into JavaScript modules with [d3-dsv](https://github.com/d3/d3-dsv).

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-dsv --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import dsv from '@rollup/plugin-dsv';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [dsv()]
};
```

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).

## Practical Example

Suppose that you have a CSV (or TSV!) file which contains some information on delicious fruits:

```csv
type,count
apples,7
pears,4
bananas,5
```

And suppose you'd like to import that CSV as an `Array` within some part of your code. After adding the plugin (as shown above), you may `import` (or `require`) the CSV file directly. The import will provide an `Array` of `Objects` representing rows from the CSV file:

```js
import fruit from './fruit.csv';

console.log(fruit);
// [
//   { type: 'apples', count: '7' },
//   { type: 'pears', count: '4' },
//   { type: 'bananas', count: '5' }
// ]
```

## Options

### `processRow`

Type: `Function`<br>
Default: `null`

Specifies a function which processes each row in the parsed array. The function can either manipulate the passed `row`, or return an entirely new row object.

This option could be used for converting numeric `string` values into `Number` values. – for example turning numeric values into numbers, e.g.

```js
dsv({
  processRow: (row, id) => {
    Object.keys(row).forEach((key) => {
      var value = row[key];
      row[key] = isNaN(+value) ? value : +value;
    });
  }
});
```

## Meta

[CONTRIBUTING](./.github/CONTRIBUTING.md)

[LICENSE (MIT)](./LICENSE)
npm package: @rollup/plugin-eslint
Description: Verify entry point and all imported files with ESLint
Author: Bogdan Chadkin
Latest version: 9.2.0

[npm]: https://img.shields.io/npm/v/@rollup/plugin-eslint
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-eslint
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-eslint
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-eslint

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-eslint

🍣 A Rollup plugin to lint entry points and all imported files with ESLint.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-eslint --save-dev
# or
yarn add -D @rollup/plugin-eslint
```

## Usage

```js
import eslint from '@rollup/plugin-eslint';

export default {
  input: 'main.js',
  plugins: [
    eslint({
      /* your options */
    })
  ]
};
```

## Options

This plugin takes a configuration object intended for the [ESLint constructor](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) with the addition of a `throwOnWarning`, `throwOnError`, `formatter`, `include` and `exclude` prop.

You can also use eslint configuration in the form of a `.eslintrc.*` file in your project's root. It will be loaded automatically.

### exclude

Type: `String | String[]`<br>
Default: `node_modules/**`

A single [`picomatch`](https://github.com/micromatch/picomatch) pattern or an array of patterns controlling which files this plugin should explicitly exclude. Gets forwarded to the [`createFilter`](https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter) method of `@rollup/pluginutils`.

### fix

Type: `Boolean`<br>
Default: `false`

If true, will auto fix source code.

### formatter

Type: `Function<String> | Function<Promise<String>> | String`<br>
Default: `stylish`

Custom error formatter, the name of a built-in formatter, or the path to a custom formatter.

### include

Type: `String | String[]`<br>
Default: `[]`

A single [`picomatch`](https://github.com/micromatch/picomatch) pattern or an array of patterns controlling which files this plugin should explicitly include. Gets forwarded to the [`createFilter`](https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter) method of `@rollup/pluginutils`.

### throwOnError

Type: `Boolean`<br>
Default: `false`

If true, will throw an error and exit the process when ESLint reports any errors.

### throwOnWarning

Type: `Boolean`<br>
Default: `false`

If true, will throw an error and exit the process when ESLint reports any warnings.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-esm-shim
Description: Generate minified bundle
Author: Peter Placzek
Latest version: 0.1.8

[npm]: https://img.shields.io/npm/v/@rollup/plugin-esm-shim
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-esm-shim
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-esm-shim
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-esm-shim

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-esm-shim

🍣 A Rollup plugin to replace CJS global variables within esm output bundles.

The list of global variables that are shimmed are:

- `__filename`: This variable corresponds to the file path of the generated bundle file.
- `__dirname`: This variable corresponds to the folder path of the created bundle file.
- `require`: Corresponds to a function to import modules in a synchronous way.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v2.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-esm-shim --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```typescript
import esmShim from '@rollup/plugin-esm-shim';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [esmShim()]
};
```

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).

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)

Portions of this code were used with permission from [unbuild](https://github.com/unjs/unbuild). [unbuild LICENSE](./unbuild.LICENSE)
npm package: @rollup/plugin-graphql
Description: Convert .gql/.graphql files to ES6 modules
Author: rollup
Latest version: 2.0.5

[npm]: https://img.shields.io/npm/v/@rollup/plugin-graphql
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-graphql
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-graphql
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-graphql

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-graphql

🍣 A Rollup plugin which Converts .gql/.graphql(s) files to ES6 modules.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-graphql --save-dev
```

## Usage

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import graphql from '@rollup/plugin-graphql';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [graphql()]
};
```

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).

With an accompanying file `src/index.js`, you can import GraphQL files or named queries/mutations:

```js
// src/index.js

// import a GraphQL Document from a GraphQL file,
import schema from './schema.graphql';

// or import named Query/Mutation
import { BatmanQuery, JokerMutation } from './schema.graphql';
```

#### Fragments

Thanks to [graphql-tag](https://github.com/apollographql/graphql-tag), fragments import is supported by using `#import "..."`.

Given the following file `heroFragment.graphql`:

```graphql
fragment HeroFragment on Hero {
  id
  name
}
```

You can import it like this:

```graphql
#import "./heroFragment.graphql"

query AllHeroes {
  heros {
    ...HeroFragment
  }
}
```

## Options

### `exclude`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)
npm package: @rollup/plugin-image
Description: Import JPG, PNG, GIF, SVG, and WebP files
Author: Rich Harris
Latest version: 3.0.3

[npm]: https://img.shields.io/npm/v/@rollup/plugin-image
[npm-url]: https://www.npmjs.com/package/@rollup/plugin-image
[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-image
[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-image

[![npm][npm]][npm-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)

# @rollup/plugin-image

🍣 A Rollup plugin which imports JPG, PNG, GIF, SVG, and WebP files.

Images are encoded using base64, which means they will be 33% larger than the size on disk. You should therefore only use this for small images where the convenience of having them available on startup (e.g. rendering immediately to a canvas without co-ordinating asynchronous loading of several images) outweighs the cost.

## Requirements

This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.

## Install

Using npm:

```console
npm install @rollup/plugin-image --save-dev
```

## Usage

Assuming a `src/index.js` exists and contains code like the following:

```js
import logo from './rollup.png';

console.log(logo);
```

Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin:

```js
import image from '@rollup/plugin-image';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [image()]
};
```

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).

Once the bundle is executed, the `console.log` will display the Base64 encoded representation of the image.

## Options

### `dom`

Type: `Boolean`<br>
Default: `false`

If `true`, instructs the plugin to generate an ES Module which exports a DOM `Image` which can be used with a browser's DOM. Otherwise, the plugin generates an ES Module which exports a `default const` containing the Base64 representation of the image.

Using this option set to `true`, the export can be used as such:

```js
import logo from './rollup.png';
document.body.appendChild(logo);
```

### `exclude`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored.

### `include`

Type: `String` | `Array[...String]`<br>
Default: `null`

A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted.

## Meta

[CONTRIBUTING](/.github/CONTRIBUTING.md)

[LICENSE (MIT)](/LICENSE)