我首先在项目里 npm install sentry-mina --save 安装了SDK,然后项目里写的代码: import * as sentry from "sentry-mina/browser/sentry-mina.js"; /** sentry SDK */ public initSentry() { sentry.init({ dsn: "" }); // sentry.configureScope(scope => { scope.setUser({ id: "4711" }); scope.setTag("user_mode", "admin"); scope.setExtra("battery", 0.7); }); // sentry.addBreadcrumb({ message: "My Breadcrumb" }); // sentry.captureMessage("Hello, world!"); sentry.captureException(new Error("Good bye")); sentry.captureEvent({ message: "Manual", stacktrace: [ ] }); } 然后我的webpack.config.js配置是: const uglify = require("uglifyjs-webpack-plugin"); const path = require("path"); module.exports = { entry: "./src/Main/LWSdk.ts", module: { rules: [ { test: /\.tsx?$/, use: "ts-loader", // exclude: /node_modules/ } ] }, resolve: { extensions: [".tsx", ".ts", ".js"] }, plugins: [new uglify()], output: { path: path.resolve(__dirname, "dist"), filename: "LWGSDK.js", library: "SDK", libraryTarget: "umd" } };
微信小游戏可是使用 Sentry SDK 吗?打包项目的时候一直报错请问微信小游戏可是使用 Sentry SDK 吗?打包项目的时候一直报如下错误: ERROR in ******.js from UglifyJs Unexpected token operator «*», expected punc «(» ..... 我搜索过这类报错的解决方案,尝试过一遍都没有用
2019-08-27