
Product
Socket for Asana Is Now Available
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.
@umengfe/rollup-plugin-uapm-trycatch
Advanced tools
rollup plugin 可自动对文件中存在的Catch表达式插入友盟WEB/小程序的异常上报的脚本
Install:
npm install --save-dev @alife/rollup-plugin-uapm-trycatch
| 支持平台 | 是否支持 |
|---|---|
| WEB/H5 | - [x] |
| 微信小程序 | - [x] |
| 支付宝小程序 | - [x] |
| 配置参数 | 是否必选 | 参数说明 | 参数类型 | 示例 |
|---|---|---|---|---|
| include | 否 | 包含的文件及路径规则 | string[] | include: ['/*.tsx', '/*.ts'] |
| exclude | 否 | 排除的文件及路径规则 | string[] | exclude: ['**/node_modules'] |
| platform | 否 | 目标构建平台,支持(wechat、web、alipay) | string | platform: 'web' |
目标构建平台也可配合构建命令 通过约定的环境变量(
UAPM_PLATFORM)在package.json的构建命令中进行指定,同时配置取值优先级options高于全局变量
// package.json
{
"name": "",
"version": "0.1.0",
"scripts": {
"build:h5": "cross-env UAPM_PLATFORM=web npm run build"
}
}
before:
const fn = () => {
try {
console.log(test);
} catch (error) {}
};
after:
const fn = () => {
try {
console.log(test);
} catch (error) {
// WEB
+ try { window && window._apm && window._apm.captureException && window._apm.captureException(error); } catch(e){}
// 小程序
+ try { wx && wx.umapm && wx.$umapm.captureException && wx.$umapm.captureException(error); } catch(e){}
// 支付宝
+ try { my && my.$umapm && my.$umapm.captureException && my.$umapm.captureException(error); } catch(e){}
}
};
.vite.config.ts
export default defineConfig({
plugins: [
vue(),
vueJsx(),
+ tryCatchPlugin({
+ include: ['*.ts', '**/*.ts'],
+ platform: 'web'
+ })
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
FAQs
> rollup plugin 可自动对文件中存在的Catch表达式插入友盟WEB/小程序的异常上报的脚本
The npm package @umengfe/rollup-plugin-uapm-trycatch receives a total of 1 weekly downloads. As such, @umengfe/rollup-plugin-uapm-trycatch popularity was classified as not popular.
We found that @umengfe/rollup-plugin-uapm-trycatch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.

Product
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.