unplugin-opentelemetry

Register global imports on demand for Vite and Webpack

Usage no npm install needed!

<script type="module">
  import unpluginOpentelemetry from 'https://cdn.skypack.dev/unplugin-opentelemetry';
</script>

README

unplugin-opentelemetry

NPM version

Install

npm i unplugin-opentelemetry
Vite
// vite.config.ts
import otel from 'unplugin-opentelemetry/vite'

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

Example: playground/


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

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


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


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

This module works for both Nuxt 2 and Nuxt Vite


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