# unplugin-opentelemetry

> Register global imports on demand for Vite and Webpack

Latest version **0.1.3** (published 2021-12-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install unplugin-opentelemetry
pnpm add unplugin-opentelemetry
yarn add unplugin-opentelemetry
bun add unplugin-opentelemetry
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2021-12-18 |
| First published | 2021-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 270.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | emattiza |
| Keywords | unplugin, vite, webpack, rollup, transform |

## Links

- npm: https://www.npmjs.com/package/unplugin-opentelemetry
- Repository: https://github.com/emattiza/unplugin-opentelemetry
- Homepage: https://github.com/emattiza/unplugin-opentelemetry#readme
- Issues: https://github.com/emattiza/unplugin-opentelemetry/issues
- npm.io page: https://npm.io/package/unplugin-opentelemetry

## Dependencies (4)

- [unplugin](https://npm.io/package/unplugin.md) ^0.2.7
- [@opentelemetry/api](https://npm.io/package/@opentelemetry/api.md) ^1.0.3
- [@opentelemetry/sdk-node](https://npm.io/package/@opentelemetry/sdk-node.md) ^0.27.0
- [@opentelemetry/exporter-otlp-grpc](https://npm.io/package/@opentelemetry/exporter-otlp-grpc.md) ^0.26.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

- 0.1.3 (latest) — 2021-12-18
- 0.1.2 — 2021-12-18

## README

# unplugin-opentelemetry

[![NPM version](https://img.shields.io/npm/v/unplugin-opentelemetry?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-opentelemetry)

## Install

```bash
npm i unplugin-opentelemetry
```

<details>
<summary>Vite</summary><br>

```ts
// vite.config.ts
import otel from 'unplugin-opentelemetry/vite'

export default defineConfig({
  plugins: [
    otel({ /* options */ }),
  ],
})
```

Example: [`playground/`](./playground/)

<br></details>

<details>
<summary>Rollup</summary><br>

```ts
// rollup.config.js
import otel from 'unplugin-opentelemetry/rollup'

export default {
  plugins: [
    otel({ /* options */ }),
  ],
}
```

<br></details>


<details>
<summary>Webpack</summary><br>

```ts
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-opentelemetry/webpack')({ /* options */ })
  ]
}
```

<br></details>

<details>
<summary>Nuxt</summary><br>

```ts
// nuxt.config.js
export default {
  buildModules: [
    ['unplugin-opentelemetry/nuxt', { /* options */ }],
  ],
}
```

> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)

<br></details>

<details>
<summary>Vue CLI</summary><br>

```ts
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-opentelemetry/webpack')({ /* options */ }),
    ],
  },
}
```

<br></details>

---
_Source: https://npm.io/package/unplugin-opentelemetry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
