# @what-src/babel-plugin

> what-src babel-plugin.

Latest version **1.1.2-alpha.0** (published 2019-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @what-src/babel-plugin
pnpm add @what-src/babel-plugin
yarn add @what-src/babel-plugin
bun add @what-src/babel-plugin
```

## 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 | 1.1.2-alpha.0 |
| Published | 2019-10-01 |
| First published | 2019-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.9.0 |
| Dependencies | 0 |
| Unpacked size | 24.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Scott Doucet |
| Maintainers | duroktar |

## Links

- npm: https://www.npmjs.com/package/@what-src/babel-plugin
- Repository: https://github.com/duroktar/what-src/tree/master/packages/what-src-plugin-babel
- npm.io page: https://npm.io/package/@what-src/babel-plugin

## Recent versions

- 1.1.2-alpha.0 (latest) — 2019-10-01
- 1.1.1-alpha.0 — 2019-09-30
- 1.1.0-alpha.0 — 2019-09-30
- 1.0.11 — 2019-09-25
- 1.0.10 — 2019-09-23
- 1.0.9 — 2019-09-22
- 1.0.8 — 2019-09-22
- 1.0.7 — 2019-09-22
- 1.0.6 — 2019-09-20
- 1.0.5 — 2019-09-19
- 1.0.4 — 2019-09-19
- 1.0.2 — 2019-09-19
- 1.0.1 — 2019-09-18
- 1.0.0 — 2019-09-17

## README

# @what-src/babel-plugin

> what-src babel-plugin.

Check out the [packages folder](https://github.com/duroktar/what-src/tree/master/packages) for more information.

## Usage

Via .babelrc or babel-loader.
```json
{
  "plugins": [["module:@what-src/plugin", options]]
}
```

### options

options are defined by the type

```ts
type WhatSrcPluginOptions = {
  productionMode?: boolean;
  enableXkcdMode?: boolean;
  useRemote?: boolean;
  serverUrl?: string;
  dataTag?: string;
  globalCacheKey?: string;
  stopPropagation?: boolean;
  preventDefault?: boolean;
};
```

<br />

#### - productionMode: [boolean]
  - Set 'true' to enable running what-src in production mode (default: `false`)

#### - enableXkcdMode: [boolean]
  - Set `true` to enable the click tracking feature and have your clicks (and
    everyone else's if `useRemote` is also used) count towards the total time
    saved number displayed on the [website](https://duroktar.github.io/what-src/)
    (default: `false`)

#### - useRemote: [boolean]
  - Set 'true' to enable remote mode which creates links to the source code on github (default: `false`)
  > Note: This requires your code to be in a valid `.git` directory. The generated
  > url will be based on the current branch at the time the code is compiled by
  > babel .

#### - serverUrl: [string]
  - The full URL of the running @what-src/express server (default: `http://localhost:8018/__what_src`)

#### - dataTag: [string]
  - A [valid](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes#HTML_syntax) data attribute for tagging elements (default: `data-what-src`)

#### - globalCacheKey: [string]
  - The global cache key the click callback is keyed to (default: `__what-src-global-callback-key`)

#### - stopPropagation: [boolean]
  - Sets the stopPropagation property of the click event (default: `true`)

#### - preventDefault: [boolean]
  - Sets the preventDefault property of the click event (default: `true`)

## License

[MIT](https://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/@what-src/babel-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
