1.0.0 • Published 2 years ago

webpack-bugclear-plugin v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

bugClear-plugin

a webpack plugin to upload source maps to any server you want.You can configure the upload server address.The current version 1 is compatible with webpack 4 and 5 and requires at least NodeJS 6.

Installation

Using npm:

$ npm install webpack-bugclear-plugin --save-dev

Using yarn:

$ yarn add webpack-bugclear-plugin --dev

Usage

  1. Require webpack-bugclear-plugin:
var SentryPlugin = require('webpack-bugclear-plugin');
  1. Configure webpack to output source maps

3.Add to webpack config:

var config = {
 plugins: [
   new SentryPlugin({
    // Required
     baseURL: 'url to upload sourceMap', // string, source map文件上传地址
     project: 'your-project-name', // string, 项目名称
     release: 'v1.0', // string, 版本名称
     // Options
     include: /\.map$/, // RegExp,正则表达式,定义要上传的文件类型
     exclude: /\.js$/, // RegExp,正则表达式,定义不上传的文件类型
     suppressErrors: true, // Boolean, 将构建错误显示为警告
     filenameTransform: (filename) => `~/${filename}`, // Function,上传的文件名转换
     uploadFileRequestOptions: {}, // Object,上传文件请求参数配置
     uploadFilesConcurrency: Infinity, // Number, 同时上传数量限制
     deleteAfterCompile: true, // Boolean, 确定在 webpack 编译完成后是否应在构建服务器上删除sourceMap文件
     deleteRegex: /\.map$/ //RegExp, 删除匹配的文件类型
   })
 ]
}