diff --git a/gulpfile.js b/gulpfile.js index cb40c3c23..daf20fbe7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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`; @@ -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) { diff --git a/vite.config.ts b/vite.config.ts index 2e3793d24..481eccfa0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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',