npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

emnj-sentry-webpack-plugin

v1.0.2

Published

基于@sentry/webpack-plugin的封装,简化配置,固定官方版本

Downloads

6

Readme

emnj-sentry-webpack-plugin

  1. 这个项目主要目的是简化基于webpack构建的项目,上传sourcemaps到平台的配置。
  2. 由于官方的插件@sentry/webpack-plugin更新非常快,最新版已经不适配当前私有化部署版本了。所以通过当前项目固定官方插件版本。

文档地址

使用文档

安装

# npm
npm i emnj-sentry-webpack-plugin
# yarn
yarn add emnj-sentry-webpack-plugin
# pnpm
pnpm install emnj-sentry-webpack-plugin

如何使用

EmnjSentryWebpackPlugin插件的所有配置参数选项和官方的1.21.0版本配置选项相同,参考地址:1.21.0版本配置选项

webpack配置

const EmnjSentryWebpackPlugin = require('emnj-sentry-webpack-plugin');

const isBuildProd = process.env.BUILD_ENV == 'production';

const plugins = []
if (isBuildProd) {
    plugins.push(new EmnjSentryWebpackPlugin({
            // 建议每次发布一个生产版本,release版本变更一下  
            release: '1.0.0',
            org: "your org",
            project: "your project",
            // 重要:资源上传的url,不配置这是sentry官网的域名。
            url: 'https://*******.com/',
            // 重要:认证的token
            authToken: '**********************',
            // 只需要是打包后资源目录下的js和map文件
            include: ['./dist/**/*.js', './dist/**/*.map'],
            // 根目录下可以配置忽略上传的文件规则
            ignoreFile: '.sentrycliignore',
            ignore: ['node_modules', 'webpack.config.js'],
            configFile: 'sentry.properties',
            // 这个比较重要,未配置正确,这无法和源代码映射
            urlPrefix: '~/qn/js'
        })
    )
}

// 事例
const config = {
  plugins: plugins,
};

vue2项目vue.config.js配置

const EmnjSentryWebpackPlugin = require('emnj-sentry-webpack-plugin');

const isBuildProd = process.env.BUILD_ENV == 'production';

module.exports = {
    chainWebpack: config => {
        if (isBuildProd) {
            // 生产环境配置
            // 1.配置sentry
            config.plugin('emnj-sentry-webpack-plugin').use(EmnjSentryWebpackPlugin, [
                {
                    // 建议每次发布一个生产版本,release版本变更一下  
                    release: '1.0.0',
                    org: "your org",
                    project: "your project",
                    // 重要:资源上传的url,不配置这是sentry官网的域名。
                    url: 'https://*******.com/',
                    // 重要:认证的token
                    authToken: '**********************',
                    // 只需要是打包后资源目录下的js和map文件
                    include: ['./dist/**/*.js', './dist/**/*.map'],
                    // 根目录下可以配置忽略上传的文件规则
                    ignoreFile: '.sentrycliignore',
                    ignore: ['node_modules', 'webpack.config.js'],
                    configFile: 'sentry.properties',
                    // 这个比较重要,未配置正确,这无法和源代码映射
                    urlPrefix: '~/qn/js'
                }
            ]);
        }
    }
}

更详细参考文档参考内部文档webpack构建上传sourcemaps