From 6fd5a04e37f2f4aaec20e3eec0e526a5012b8e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=9C=A3=E5=B3=B0?= Date: Sat, 5 Nov 2022 14:30:38 +0800 Subject: [PATCH] feat: add "publish" --- src/resolvers.ts | 1 + src/runtime.ts | 9 +++++---- src/virtual-module.ts | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/resolvers.ts b/src/resolvers.ts index ebb7ed7..8bcf1cb 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -136,6 +136,7 @@ function mergeSentryOptions(options: Options, bundlerConfig: Partial & urlPrefix?: string env?: string }) { + options.publish = !!options.publish options.release ||= bundlerConfig.release options.deploy ||= {} options.deploy.env ||= bundlerConfig.env || process.env.NODE_ENV diff --git a/src/runtime.ts b/src/runtime.ts index ccd5ba2..9b75f94 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -1,6 +1,7 @@ declare module 'virtual-unplugin-sentry-runtime' { - export const ORG: string - export const PROJECT: string - export const ENV: string - export const RELEASE: string + export const ORG: string | undefined + export const PROJECT: string | undefined + export const ENV: string | undefined + export const RELEASE: string | undefined + export const PUBLISH: boolean | undefined } diff --git a/src/virtual-module.ts b/src/virtual-module.ts index a7ae431..44afe43 100644 --- a/src/virtual-module.ts +++ b/src/virtual-module.ts @@ -9,5 +9,6 @@ export function getVirtualContent(options: Options): string { export const PROJECT = ${JSON.stringify(options.project)}; export const ENV = ${JSON.stringify(options.deploy?.env)}; export const RELEASE = ${JSON.stringify(options.release)}; + export const PUBLISH = ${JSON.stringify(options.publish)}; ` }