@sentry/vite-plugin 2.21.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -89,6 +89,12 @@ export default defineConfig({
89
89
  - [`deploy`](#releasedeploy)
90
90
  - [`cleanArtifacts`](#releasecleanartifacts)
91
91
  - [`uploadLegacySourcemaps`](#releaseuploadlegacysourcemaps)
92
+ - [`bundleSizeOptimizations`](#bundlesizeoptimizations)
93
+ - [`excludeDebugStatements`](#bundlesizeoptimizationsexcludedebugstatements)
94
+ - [`excludeTracing`](#bundlesizeoptimizationsexcludetracing)
95
+ - [`excludeReplayShadowDom`](#bundlesizeoptimizationsexcludereplayshadowdom)
96
+ - [`excludeReplayIframe`](#bundlesizeoptimizationsexcludereplayiframe)
97
+ - [`excludeReplayWorker`](#bundlesizeoptimizationsexcludereplayworker)
92
98
  - [`reactComponentAnnotation`](#reactcomponentannotation)
93
99
  - [`enabled`](#reactcomponentannotationenabled)
94
100
  - [`moduleMetadata`](#modulemetadata)
@@ -503,6 +509,56 @@ type IncludeEntry = {
503
509
 
504
510
 
505
511
 
512
+ ### `bundleSizeOptimizations`
513
+
514
+
515
+
516
+ Options related to bundle size optimizations. These options will allow you to optimize and reduce the bundle size of the Sentry SDK.
517
+ ### `bundleSizeOptimizations.excludeDebugStatements`
518
+
519
+ Type: `boolean`
520
+
521
+ If set to `true`, the plugin will attempt to tree-shake (remove) any debugging code within the Sentry SDK.
522
+ Note that the success of this depends on tree shaking being enabled in your build tooling.
523
+
524
+ Setting this option to `true` will disable features like the SDK's `debug` option.
525
+
526
+ ### `bundleSizeOptimizations.excludeTracing`
527
+
528
+ Type: `boolean`
529
+
530
+ If set to `true`, the plugin will attempt to tree-shake (remove) code within the Sentry SDK that is related to tracing and performance monitoring.
531
+ Note that the success of this depends on tree shaking being enabled in your build tooling.
532
+
533
+ **Notice:** Do not enable this when you're using any performance monitoring-related SDK features (e.g. `Sentry.startTransaction()`).
534
+
535
+ ### `bundleSizeOptimizations.excludeReplayShadowDom`
536
+
537
+ Type: `boolean`
538
+
539
+ If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay Shadow DOM recording functionality.
540
+ Note that the success of this depends on tree shaking being enabled in your build tooling.
541
+
542
+ This option is safe to be used when you do not want to capture any Shadow DOM activity via Sentry Session Replay.
543
+
544
+ ### `bundleSizeOptimizations.excludeReplayIframe`
545
+
546
+ Type: `boolean`
547
+
548
+ If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay `iframe` recording functionality.
549
+ Note that the success of this depends on tree shaking being enabled in your build tooling.
550
+
551
+ You can safely do this when you do not want to capture any `iframe` activity via Sentry Session Replay.
552
+
553
+ ### `bundleSizeOptimizations.excludeReplayWorker`
554
+
555
+ Type: `boolean`
556
+
557
+ If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay's Compression Web Worker.
558
+ Note that the success of this depends on tree shaking being enabled in your build tooling.
559
+
560
+ **Notice:** You should only do use this option if you manually host a compression worker and configure it in your Sentry Session Replay integration config via the `workerUrl` option.
561
+
506
562
  ### `reactComponentAnnotation`
507
563
 
508
564
 
package/dist/cjs/index.js CHANGED
@@ -7,7 +7,9 @@ var bundlerPluginCore = require('@sentry/bundler-plugin-core');
7
7
  function viteReleaseInjectionPlugin(injectionCode) {
8
8
  return {
9
9
  name: "sentry-vite-release-injection-plugin",
10
- enforce: "pre",
10
+ // run `post` to avoid tripping up @rollup/plugin-commonjs when cjs is used
11
+ // as we inject an `import` statement
12
+ enforce: "post",
11
13
  // need this so that vite runs the resolveId hook
12
14
  vite: bundlerPluginCore.createRollupReleaseInjectionHooks(injectionCode)
13
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupModuleMetadataInjectionHooks,\n createRollupDebugIdInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n enforce: \"pre\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteComponentNameAnnotatePlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-component-name-annotate-plugin\",\n enforce: \"pre\" as const,\n vite: createComponentNameAnnotateHooks(),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nfunction viteModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-module-metadata-injection-plugin\",\n vite: createRollupModuleMetadataInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload),\n };\n}\n\nfunction viteBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-vite-bundle-size-optimizations-plugin\",\n vite: createRollupBundleSizeOptimizationHooks(replacementValues),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: viteModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options?: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteComponentNameAnnotatePlugin","createComponentNameAnnotateHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","viteModuleMetadataInjectionPlugin","createRollupModuleMetadataInjectionHooks","viteDebugIdUploadPlugin","upload","createRollupDebugIdUploadHooks","viteBundleSizeOptimizationsPlugin","replacementValues","createRollupBundleSizeOptimizationHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryVitePlugin"],"mappings":";;;;;;AAaA,SAASA,0BAA0BA,CAACC,aAAqB,EAAmB;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCAAsC;AAC5CC,IAAAA,OAAO,EAAE,KAAc;AAAE;IACzBC,IAAI,EAAEC,mDAAiC,CAACJ,aAAa,CAAA;GACtD,CAAA;AACH,CAAA;AAEA,SAASK,+BAA+BA,GAAoB;EAC1D,OAAO;AACLJ,IAAAA,IAAI,EAAE,4CAA4C;AAClDC,IAAAA,OAAO,EAAE,KAAc;IACvBC,IAAI,EAAEG,kDAAgC,EAAC;GACxC,CAAA;AACH,CAAA;AAEA,SAASC,0BAA0BA,GAAoB;EACrD,OAAO;AACLN,IAAAA,IAAI,EAAE,uCAAuC;IAC7CE,IAAI,EAAEK,mDAAiC,EAAC;GACzC,CAAA;AACH,CAAA;AAEA,SAASC,iCAAiCA,CAACT,aAAqB,EAAmB;EACjF,OAAO;AACLC,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEO,0DAAwC,CAACV,aAAa,CAAA;GAC7D,CAAA;AACH,CAAA;AAEA,SAASW,uBAAuBA,CAC9BC,MAAmD,EAClC;EACjB,OAAO;AACLX,IAAAA,IAAI,EAAE,oCAAoC;IAC1CE,IAAI,EAAEU,gDAA8B,CAACD,MAAM,CAAA;GAC5C,CAAA;AACH,CAAA;AAEA,SAASE,iCAAiCA,CACxCC,iBAAsC,EACrB;EACjB,OAAO;AACLd,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEa,yDAAuC,CAACD,iBAAiB,CAAA;GAChE,CAAA;AACH,CAAA;AAEA,IAAME,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEpB,0BAA0B;AAClDqB,EAAAA,2BAA2B,EAAEf,+BAA+B;AAC5DgB,EAAAA,sBAAsB,EAAEd,0BAA0B;AAClDe,EAAAA,6BAA6B,EAAEb,iCAAiC;AAChEc,EAAAA,mBAAmB,EAAEZ,uBAAuB;AAC5Ca,EAAAA,6BAA6B,EAAEV,iCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaW,IAAAA,gBAA4C,GAAGR,cAAc,CAACd;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupModuleMetadataInjectionHooks,\n createRollupDebugIdInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n // run `post` to avoid tripping up @rollup/plugin-commonjs when cjs is used\n // as we inject an `import` statement\n enforce: \"post\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteComponentNameAnnotatePlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-component-name-annotate-plugin\",\n enforce: \"pre\" as const,\n vite: createComponentNameAnnotateHooks(),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nfunction viteModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-module-metadata-injection-plugin\",\n vite: createRollupModuleMetadataInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload),\n };\n}\n\nfunction viteBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-vite-bundle-size-optimizations-plugin\",\n vite: createRollupBundleSizeOptimizationHooks(replacementValues),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: viteModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options?: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteComponentNameAnnotatePlugin","createComponentNameAnnotateHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","viteModuleMetadataInjectionPlugin","createRollupModuleMetadataInjectionHooks","viteDebugIdUploadPlugin","upload","createRollupDebugIdUploadHooks","viteBundleSizeOptimizationsPlugin","replacementValues","createRollupBundleSizeOptimizationHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryVitePlugin"],"mappings":";;;;;;AAaA,SAASA,0BAA0BA,CAACC,aAAqB,EAAmB;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCAAsC;AAC5C;AACA;AACAC,IAAAA,OAAO,EAAE,MAAe;AAAE;IAC1BC,IAAI,EAAEC,mDAAiC,CAACJ,aAAa,CAAA;GACtD,CAAA;AACH,CAAA;AAEA,SAASK,+BAA+BA,GAAoB;EAC1D,OAAO;AACLJ,IAAAA,IAAI,EAAE,4CAA4C;AAClDC,IAAAA,OAAO,EAAE,KAAc;IACvBC,IAAI,EAAEG,kDAAgC,EAAC;GACxC,CAAA;AACH,CAAA;AAEA,SAASC,0BAA0BA,GAAoB;EACrD,OAAO;AACLN,IAAAA,IAAI,EAAE,uCAAuC;IAC7CE,IAAI,EAAEK,mDAAiC,EAAC;GACzC,CAAA;AACH,CAAA;AAEA,SAASC,iCAAiCA,CAACT,aAAqB,EAAmB;EACjF,OAAO;AACLC,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEO,0DAAwC,CAACV,aAAa,CAAA;GAC7D,CAAA;AACH,CAAA;AAEA,SAASW,uBAAuBA,CAC9BC,MAAmD,EAClC;EACjB,OAAO;AACLX,IAAAA,IAAI,EAAE,oCAAoC;IAC1CE,IAAI,EAAEU,gDAA8B,CAACD,MAAM,CAAA;GAC5C,CAAA;AACH,CAAA;AAEA,SAASE,iCAAiCA,CACxCC,iBAAsC,EACrB;EACjB,OAAO;AACLd,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEa,yDAAuC,CAACD,iBAAiB,CAAA;GAChE,CAAA;AACH,CAAA;AAEA,IAAME,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEpB,0BAA0B;AAClDqB,EAAAA,2BAA2B,EAAEf,+BAA+B;AAC5DgB,EAAAA,sBAAsB,EAAEd,0BAA0B;AAClDe,EAAAA,6BAA6B,EAAEb,iCAAiC;AAChEc,EAAAA,mBAAmB,EAAEZ,uBAAuB;AAC5Ca,EAAAA,6BAA6B,EAAEV,iCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaW,IAAAA,gBAA4C,GAAGR,cAAc,CAACd;;;;;;;;"}
@@ -4,7 +4,9 @@ export { sentryCliBinaryExists } from '@sentry/bundler-plugin-core';
4
4
  function viteReleaseInjectionPlugin(injectionCode) {
5
5
  return {
6
6
  name: "sentry-vite-release-injection-plugin",
7
- enforce: "pre",
7
+ // run `post` to avoid tripping up @rollup/plugin-commonjs when cjs is used
8
+ // as we inject an `import` statement
9
+ enforce: "post",
8
10
  // need this so that vite runs the resolveId hook
9
11
  vite: createRollupReleaseInjectionHooks(injectionCode)
10
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupModuleMetadataInjectionHooks,\n createRollupDebugIdInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n enforce: \"pre\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteComponentNameAnnotatePlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-component-name-annotate-plugin\",\n enforce: \"pre\" as const,\n vite: createComponentNameAnnotateHooks(),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nfunction viteModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-module-metadata-injection-plugin\",\n vite: createRollupModuleMetadataInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload),\n };\n}\n\nfunction viteBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-vite-bundle-size-optimizations-plugin\",\n vite: createRollupBundleSizeOptimizationHooks(replacementValues),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: viteModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options?: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteComponentNameAnnotatePlugin","createComponentNameAnnotateHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","viteModuleMetadataInjectionPlugin","createRollupModuleMetadataInjectionHooks","viteDebugIdUploadPlugin","upload","createRollupDebugIdUploadHooks","viteBundleSizeOptimizationsPlugin","replacementValues","createRollupBundleSizeOptimizationHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryVitePlugin"],"mappings":";;;AAaA,SAASA,0BAA0BA,CAACC,aAAqB,EAAmB;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCAAsC;AAC5CC,IAAAA,OAAO,EAAE,KAAc;AAAE;IACzBC,IAAI,EAAEC,iCAAiC,CAACJ,aAAa,CAAA;GACtD,CAAA;AACH,CAAA;AAEA,SAASK,+BAA+BA,GAAoB;EAC1D,OAAO;AACLJ,IAAAA,IAAI,EAAE,4CAA4C;AAClDC,IAAAA,OAAO,EAAE,KAAc;IACvBC,IAAI,EAAEG,gCAAgC,EAAC;GACxC,CAAA;AACH,CAAA;AAEA,SAASC,0BAA0BA,GAAoB;EACrD,OAAO;AACLN,IAAAA,IAAI,EAAE,uCAAuC;IAC7CE,IAAI,EAAEK,iCAAiC,EAAC;GACzC,CAAA;AACH,CAAA;AAEA,SAASC,iCAAiCA,CAACT,aAAqB,EAAmB;EACjF,OAAO;AACLC,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEO,wCAAwC,CAACV,aAAa,CAAA;GAC7D,CAAA;AACH,CAAA;AAEA,SAASW,uBAAuBA,CAC9BC,MAAmD,EAClC;EACjB,OAAO;AACLX,IAAAA,IAAI,EAAE,oCAAoC;IAC1CE,IAAI,EAAEU,8BAA8B,CAACD,MAAM,CAAA;GAC5C,CAAA;AACH,CAAA;AAEA,SAASE,iCAAiCA,CACxCC,iBAAsC,EACrB;EACjB,OAAO;AACLd,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEa,uCAAuC,CAACD,iBAAiB,CAAA;GAChE,CAAA;AACH,CAAA;AAEA,IAAME,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEpB,0BAA0B;AAClDqB,EAAAA,2BAA2B,EAAEf,+BAA+B;AAC5DgB,EAAAA,sBAAsB,EAAEd,0BAA0B;AAClDe,EAAAA,6BAA6B,EAAEb,iCAAiC;AAChEc,EAAAA,mBAAmB,EAAEZ,uBAAuB;AAC5Ca,EAAAA,6BAA6B,EAAEV,iCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaW,IAAAA,gBAA4C,GAAGR,cAAc,CAACd;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupReleaseInjectionHooks,\n createRollupModuleMetadataInjectionHooks,\n createRollupDebugIdInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions } from \"unplugin\";\n\nfunction viteReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-release-injection-plugin\",\n // run `post` to avoid tripping up @rollup/plugin-commonjs when cjs is used\n // as we inject an `import` statement\n enforce: \"post\" as const, // need this so that vite runs the resolveId hook\n vite: createRollupReleaseInjectionHooks(injectionCode),\n };\n}\n\nfunction viteComponentNameAnnotatePlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-component-name-annotate-plugin\",\n enforce: \"pre\" as const,\n vite: createComponentNameAnnotateHooks(),\n };\n}\n\nfunction viteDebugIdInjectionPlugin(): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-injection-plugin\",\n vite: createRollupDebugIdInjectionHooks(),\n };\n}\n\nfunction viteModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n return {\n name: \"sentry-vite-module-metadata-injection-plugin\",\n vite: createRollupModuleMetadataInjectionHooks(injectionCode),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload),\n };\n}\n\nfunction viteBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-vite-bundle-size-optimizations-plugin\",\n vite: createRollupBundleSizeOptimizationHooks(replacementValues),\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: viteReleaseInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdInjectionPlugin: viteDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: viteModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryVitePlugin: (options?: Options) => any = sentryUnplugin.vite;\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteReleaseInjectionPlugin","injectionCode","name","enforce","vite","createRollupReleaseInjectionHooks","viteComponentNameAnnotatePlugin","createComponentNameAnnotateHooks","viteDebugIdInjectionPlugin","createRollupDebugIdInjectionHooks","viteModuleMetadataInjectionPlugin","createRollupModuleMetadataInjectionHooks","viteDebugIdUploadPlugin","upload","createRollupDebugIdUploadHooks","viteBundleSizeOptimizationsPlugin","replacementValues","createRollupBundleSizeOptimizationHooks","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","componentNameAnnotatePlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryVitePlugin"],"mappings":";;;AAaA,SAASA,0BAA0BA,CAACC,aAAqB,EAAmB;EAC1E,OAAO;AACLC,IAAAA,IAAI,EAAE,sCAAsC;AAC5C;AACA;AACAC,IAAAA,OAAO,EAAE,MAAe;AAAE;IAC1BC,IAAI,EAAEC,iCAAiC,CAACJ,aAAa,CAAA;GACtD,CAAA;AACH,CAAA;AAEA,SAASK,+BAA+BA,GAAoB;EAC1D,OAAO;AACLJ,IAAAA,IAAI,EAAE,4CAA4C;AAClDC,IAAAA,OAAO,EAAE,KAAc;IACvBC,IAAI,EAAEG,gCAAgC,EAAC;GACxC,CAAA;AACH,CAAA;AAEA,SAASC,0BAA0BA,GAAoB;EACrD,OAAO;AACLN,IAAAA,IAAI,EAAE,uCAAuC;IAC7CE,IAAI,EAAEK,iCAAiC,EAAC;GACzC,CAAA;AACH,CAAA;AAEA,SAASC,iCAAiCA,CAACT,aAAqB,EAAmB;EACjF,OAAO;AACLC,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEO,wCAAwC,CAACV,aAAa,CAAA;GAC7D,CAAA;AACH,CAAA;AAEA,SAASW,uBAAuBA,CAC9BC,MAAmD,EAClC;EACjB,OAAO;AACLX,IAAAA,IAAI,EAAE,oCAAoC;IAC1CE,IAAI,EAAEU,8BAA8B,CAACD,MAAM,CAAA;GAC5C,CAAA;AACH,CAAA;AAEA,SAASE,iCAAiCA,CACxCC,iBAAsC,EACrB;EACjB,OAAO;AACLd,IAAAA,IAAI,EAAE,8CAA8C;IACpDE,IAAI,EAAEa,uCAAuC,CAACD,iBAAiB,CAAA;GAChE,CAAA;AACH,CAAA;AAEA,IAAME,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAEpB,0BAA0B;AAClDqB,EAAAA,2BAA2B,EAAEf,+BAA+B;AAC5DgB,EAAAA,sBAAsB,EAAEd,0BAA0B;AAClDe,EAAAA,6BAA6B,EAAEb,iCAAiC;AAChEc,EAAAA,mBAAmB,EAAEZ,uBAAuB;AAC5Ca,EAAAA,6BAA6B,EAAEV,iCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaW,IAAAA,gBAA4C,GAAGR,cAAc,CAACd;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/vite-plugin",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "description": "Official Sentry Vite plugin",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/vite-plugin",
@@ -48,7 +48,7 @@
48
48
  "prepack": "ts-node ./src/prepack.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@sentry/bundler-plugin-core": "2.21.0",
51
+ "@sentry/bundler-plugin-core": "2.22.0",
52
52
  "unplugin": "1.0.1"
53
53
  },
54
54
  "devDependencies": {
@@ -57,8 +57,8 @@
57
57
  "@babel/preset-typescript": "7.17.12",
58
58
  "@rollup/plugin-babel": "5.3.1",
59
59
  "@rollup/plugin-node-resolve": "13.3.0",
60
- "@sentry-internal/eslint-config": "2.21.0",
61
- "@sentry-internal/sentry-bundler-plugin-tsconfig": "2.21.0",
60
+ "@sentry-internal/eslint-config": "2.22.0",
61
+ "@sentry-internal/sentry-bundler-plugin-tsconfig": "2.22.0",
62
62
  "@swc/core": "^1.2.205",
63
63
  "@swc/jest": "^0.2.21",
64
64
  "@types/jest": "^28.1.3",