# gatsby-plugin-compile-es6-packages

> Easily add support for compiling ES6 packages into Gasby projects

Latest version **2.1.1** (published 2021-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-plugin-compile-es6-packages
pnpm add gatsby-plugin-compile-es6-packages
yarn add gatsby-plugin-compile-es6-packages
bun add gatsby-plugin-compile-es6-packages
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-08-26 |
| First published | 2018-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Rob Walker |
| Maintainers | robwalkerco |
| Keywords | gatsby, gatsby-plugin, es6, webpack |

## Links

- npm: https://www.npmjs.com/package/gatsby-plugin-compile-es6-packages
- Repository: https://github.com/robwalkerco/gatsby-plugin-compile-es6-packages
- Homepage: https://github.com/robwalkerco/gatsby-plugin-compile-es6-packages#readme
- Issues: https://github.com/robwalkerco/gatsby-plugin-compile-es6-packages/issues
- npm.io page: https://npm.io/package/gatsby-plugin-compile-es6-packages

## Dependencies (2)

- [regex-escape](https://npm.io/package/regex-escape.md) ^3.4.8
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2021-08-26
- 2.1.0 — 2019-07-25
- 2.0.1 — 2019-07-22
- 2.0.0 — 2019-07-16
- 1.2.0 — 2019-07-15
- 1.1.0 — 2019-03-27
- 1.0.6 — 2018-09-21
- 1.0.5 — 2018-09-21
- 1.0.4 — 2018-09-21
- 1.0.3 — 2018-09-21
- 1.0.2 — 2018-09-21
- 1.0.1 — 2018-09-21
- 1.0.0 — 2018-09-21

## README

# gatsby-plugin-compile-es6-packages

[![npm version](https://img.shields.io/npm/v/gatsby-plugin-compile-es6-packages.svg?style=flat-square)](https://www.npmjs.com/package/gatsby-plugin-compile-es6-packages)
[![npm downloads](https://img.shields.io/npm/dt/gatsby-plugin-compile-es6-packages.svg?style=flat-square)](https://www.npmjs.com/package/gatsby-plugin-compile-es6-packages)

Allows you to easily specify npm modules to be included in transpiling with babel.

This plugin works with Gatsby V2+

Discussion of this issue at https://github.com/gatsbyjs/gatsby/issues/3780

## Install

`npm install --save gatsby-plugin-compile-es6-packages`

or

`yarn add gatsby-plugin-compile-es6-packages`

## How to use

Add the plugin to your `gatsby-config.js`.
Specify the npm modules containing ES6 code that require transpilation.

```javascript
plugins: [
  {
    resolve: `gatsby-plugin-compile-es6-packages`,
    options: {
      modules: [`query-string`]
    }
  }
];
```

### Options

| Option    | Explanation                                                            | Default   | Required |
| --------- | ---------------------------------------------------------------------- | --------- | -------- |
| `modules` | Specify the npm modules containing ES6 code that require transpilation | `[]`      | YES      |
| `test`    | Adjusts the regex for the webpack rule                                 | `/\.js$/` | NO       |

You may also need to use other plugins to handle any specific babel config to transpile the es6 code (i.e. `gatsby-plugin-flow`)

---
_Source: https://npm.io/package/gatsby-plugin-compile-es6-packages · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
