Skip to content

Commit

Permalink
build: sentry instrumentation (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
Razboy20 authored Oct 17, 2024
1 parent e261641 commit e082158
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// (Thanks go to https://github.com/pnd280/complexity/blob/alpha/gulpfile.js)

import cp from 'child_process';
import fs from 'fs';
import gulp from 'gulp';
import gulpZip from 'gulp-zip';
import { createRequire } from 'module';

function zip() {
// Make sure sentry is configured https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/typescript/#2-configure-sentry-cli
function instrumentWithSentry() {
return cp.exec('sentry-cli sourcemaps inject dist/ && sentry-cli sourcemaps upload dist/');
}

function zipDist() {
const require = createRequire(import.meta.url);
const manifest = require('./package.json');
const zipFileName = `${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`;
Expand All @@ -18,6 +24,8 @@ function zip() {
.pipe(gulp.dest('package'));
}

const zip = gulp.series(instrumentWithSentry, zipDist);

// Temp fix for CSP on Chrome 130
// Manually remove them because there is no option to disable use_dynamic_url on @crxjs/vite-plugin
function forceDisableUseDynamicUrl(done) {
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default defineConfig({
target: ['chrome120', 'edge120', 'firefox120'],
emptyOutDir: true,
reportCompressedSize: false,
sourcemap: true,
rollupOptions: {
input: {
debug: 'src/pages/debug/index.html',
Expand Down

0 comments on commit e082158

Please sign in to comment.