Skip to content

ohbug-org/unplugin-ohbug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ohbug/unplugin

npm npm bundle size

English | 简体中文

Auto upload your sourceMap files to Ohbug for Vite, Webpack and Rollup. Powered by unplugin.

Installation

npm install @ohbug/unplugin -D

Usage

Vite
// vite.config.ts
import OhbugUnplugin from '@ohbug/unplugin/vite'

export default defineConfig({
  plugins: [
    OhbugUnplugin({
      apiKey: 'YOUR_API_KEY',
      appVersion: 'YOUR_APP_VERSION',
    }),
  ],
})

Example: playground/


Rollup
// rollup.config.js
import OhbugUnplugin from '@ohbug/unplugin/rollup'

export default {
  plugins: [
    OhbugUnplugin({
      apiKey: 'YOUR_API_KEY',
      appVersion: 'YOUR_APP_VERSION',
    }),
    // other plugins
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('@ohbug/unplugin/webpack')({
      apiKey: 'YOUR_API_KEY',
      appVersion: 'YOUR_APP_VERSION',
    }),
  ],
}


Nuxt
// nuxt.config.js
export default {
  buildModules: [
    [
      '@ohbug/unplugin/nuxt',
      {
        apiKey: 'YOUR_API_KEY',
        appVersion: 'YOUR_APP_VERSION',
      },
    ],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('@ohbug/unplugin/webpack')({
        apiKey: 'YOUR_API_KEY',
        appVersion: 'YOUR_APP_VERSION',
      }),
    ],
  },
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'
import Starter from '@ohbug/unplugin/esbuild'

build({ plugins: [Starter()] })


Options

interface Options {
  apiKey: string
  appVersion: string
  appType?: string
  endpoint?: string
  deleteAfterUploading?: boolean
}

apiKey

Your project API key.

appVersion

The version number of your app. Conveniently locate the problem version.

appType

The type of your app. If your app's codebase contains different entries, but reports to the same service, you may need to add appType to indicate the type of entry for the source of the problem.

endpoint

The url of the upload server

deleteAfterUploading

default is false

About

plugin for upload your sourceMap files to Ohbug

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published