@sentry/vite-plugin 4.9.1 → 5.1.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/dist/cjs/index.js CHANGED
@@ -1,68 +1,27 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _sentry_rollup_plugin = require("@sentry/rollup-plugin");
3
+ let node_module = require("node:module");
4
+ let _sentry_bundler_plugin_core = require("@sentry/bundler-plugin-core");
2
5
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var bundlerPluginCore = require('@sentry/bundler-plugin-core');
6
- var node_module = require('node:module');
7
-
8
- function viteInjectionPlugin(injectionCode, debugIds) {
9
- return {
10
- name: "sentry-vite-injection-plugin",
11
- // run `post` to avoid tripping up @rollup/plugin-commonjs when cjs is used
12
- // as we inject an `import` statement
13
- enforce: "post",
14
- // need this so that vite runs the resolveId hook
15
- vite: bundlerPluginCore.createRollupInjectionHooks(injectionCode, debugIds)
16
- };
17
- }
18
- function viteComponentNameAnnotatePlugin(ignoredComponents, injectIntoHtml) {
19
- return {
20
- name: "sentry-vite-component-name-annotate-plugin",
21
- enforce: "pre",
22
- vite: bundlerPluginCore.createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml)
23
- };
24
- }
25
- function viteDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts) {
26
- return {
27
- name: "sentry-vite-debug-id-upload-plugin",
28
- vite: bundlerPluginCore.createRollupDebugIdUploadHooks(upload, logger, createDependencyOnBuildArtifacts)
29
- };
30
- }
31
- function viteBundleSizeOptimizationsPlugin(replacementValues) {
32
- return {
33
- name: "sentry-vite-bundle-size-optimizations-plugin",
34
- vite: bundlerPluginCore.createRollupBundleSizeOptimizationHooks(replacementValues)
35
- };
36
- }
6
+ //#region src/index.ts
37
7
  function getViteMajorVersion() {
38
- try {
39
- var _vite$version;
40
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
41
- // @ts-ignore - Rollup already transpiles this for us
42
- var req = node_module.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href)));
43
- var vite = req("vite");
44
- return (_vite$version = vite.version) === null || _vite$version === void 0 ? void 0 : _vite$version.split(".")[0];
45
- } catch (err) {
46
- // do nothing, we'll just not report a version
47
- }
48
- return undefined;
8
+ try {
9
+ return (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("vite").version?.split(".")[0];
10
+ } catch (err) {}
49
11
  }
50
- var sentryUnplugin = bundlerPluginCore.sentryUnpluginFactory({
51
- injectionPlugin: viteInjectionPlugin,
52
- componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,
53
- debugIdUploadPlugin: viteDebugIdUploadPlugin,
54
- bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,
55
- getBundlerMajorVersion: getViteMajorVersion
56
- });
57
- var sentryVitePlugin = function sentryVitePlugin(options) {
58
- var result = sentryUnplugin.vite(options);
59
- // unplugin returns a single plugin instead of an array when only one plugin is created, so we normalize this here.
60
- return Array.isArray(result) ? result : [result];
12
+ const sentryVitePlugin = (options) => {
13
+ return [{
14
+ enforce: "pre",
15
+ ...(0, _sentry_rollup_plugin._rollupPluginInternal)(options, "vite", getViteMajorVersion())
16
+ }];
61
17
  };
62
18
 
19
+ //#endregion
63
20
  Object.defineProperty(exports, 'sentryCliBinaryExists', {
64
21
  enumerable: true,
65
- get: function () { return bundlerPluginCore.sentryCliBinaryExists; }
22
+ get: function () {
23
+ return _sentry_bundler_plugin_core.sentryCliBinaryExists;
24
+ }
66
25
  });
67
26
  exports.sentryVitePlugin = sentryVitePlugin;
68
- //# sourceMappingURL=index.js.map
27
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n CodeInjection,\n sentryUnpluginFactory,\n Options,\n createRollupInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport { createRequire } from \"node:module\";\nimport { UnpluginOptions, VitePlugin } from \"unplugin\";\n\nfunction viteInjectionPlugin(injectionCode: CodeInjection, debugIds: boolean): UnpluginOptions {\n return {\n name: \"sentry-vite-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: createRollupInjectionHooks(injectionCode, debugIds),\n };\n}\n\nfunction viteComponentNameAnnotatePlugin(\n ignoredComponents: string[],\n injectIntoHtml: boolean\n): UnpluginOptions {\n return {\n name: \"sentry-vite-component-name-annotate-plugin\",\n enforce: \"pre\" as const,\n vite: createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload, logger, createDependencyOnBuildArtifacts),\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\nfunction getViteMajorVersion(): string | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Rollup already transpiles this for us\n const req = createRequire(import.meta.url);\n const vite = req(\"vite\") as { version?: string };\n return vite.version?.split(\".\")[0];\n } catch (err) {\n // do nothing, we'll just not report a version\n }\n\n return undefined;\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n injectionPlugin: viteInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\n getBundlerMajorVersion: getViteMajorVersion,\n});\n\nexport const sentryVitePlugin = (options?: Options): VitePlugin[] => {\n const result = sentryUnplugin.vite(options);\n // unplugin returns a single plugin instead of an array when only one plugin is created, so we normalize this here.\n return Array.isArray(result) ? result : [result];\n};\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteInjectionPlugin","injectionCode","debugIds","name","enforce","vite","createRollupInjectionHooks","viteComponentNameAnnotatePlugin","ignoredComponents","injectIntoHtml","createComponentNameAnnotateHooks","viteDebugIdUploadPlugin","upload","logger","createDependencyOnBuildArtifacts","createRollupDebugIdUploadHooks","viteBundleSizeOptimizationsPlugin","replacementValues","createRollupBundleSizeOptimizationHooks","getViteMajorVersion","_vite$version","req","createRequire","import","version","split","err","undefined","sentryUnplugin","sentryUnpluginFactory","injectionPlugin","componentNameAnnotatePlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","getBundlerMajorVersion","sentryVitePlugin","options","result","Array","isArray"],"mappings":";;;;;;;AAcA,SAASA,mBAAmBA,CAACC,aAA4B,EAAEC,QAAiB,EAAmB;EAC7F,OAAO;AACLC,IAAAA,IAAI,EAAE,8BAA8B;AACpC;AACA;AACAC,IAAAA,OAAO,EAAE,MAAe;AAAE;AAC1BC,IAAAA,IAAI,EAAEC,4CAA0B,CAACL,aAAa,EAAEC,QAAQ,CAAA;GACzD,CAAA;AACH,CAAA;AAEA,SAASK,+BAA+BA,CACtCC,iBAA2B,EAC3BC,cAAuB,EACN;EACjB,OAAO;AACLN,IAAAA,IAAI,EAAE,4CAA4C;AAClDC,IAAAA,OAAO,EAAE,KAAc;AACvBC,IAAAA,IAAI,EAAEK,kDAAgC,CAACF,iBAAiB,EAAEC,cAAc,CAAA;GACzE,CAAA;AACH,CAAA;AAEA,SAASE,uBAAuBA,CAC9BC,MAAmD,EACnDC,MAAc,EACdC,gCAAkD,EACjC;EACjB,OAAO;AACLX,IAAAA,IAAI,EAAE,oCAAoC;AAC1CE,IAAAA,IAAI,EAAEU,gDAA8B,CAACH,MAAM,EAAEC,MAAM,EAAEC,gCAAgC,CAAA;GACtF,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,SAASE,mBAAmBA,GAAuB;EACjD,IAAI;AAAA,IAAA,IAAAC,aAAA,CAAA;AACF;AACA;IACA,IAAMC,GAAG,GAAGC,yBAAa,CAACC,mMAAe,CAAC,CAAA;AAC1C,IAAA,IAAMlB,IAAI,GAAGgB,GAAG,CAAC,MAAM,CAAyB,CAAA;AAChD,IAAA,OAAA,CAAAD,aAAA,GAAOf,IAAI,CAACmB,OAAO,cAAAJ,aAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAZA,aAAA,CAAcK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;GACnC,CAAC,OAAOC,GAAG,EAAE;AACZ;AAAA,GAAA;AAGF,EAAA,OAAOC,SAAS,CAAA;AAClB,CAAA;AAEA,IAAMC,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,eAAe,EAAE9B,mBAAmB;AACpC+B,EAAAA,2BAA2B,EAAExB,+BAA+B;AAC5DyB,EAAAA,mBAAmB,EAAErB,uBAAuB;AAC5CsB,EAAAA,6BAA6B,EAAEjB,iCAAiC;AAChEkB,EAAAA,sBAAsB,EAAEf,mBAAAA;AAC1B,CAAC,CAAC,CAAA;IAEWgB,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,OAAiB,EAAmB;AACnE,EAAA,IAAMC,MAAM,GAAGT,cAAc,CAACvB,IAAI,CAAC+B,OAAO,CAAC,CAAA;AAC3C;EACA,OAAOE,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,CAAA;AAClD;;;;;;;;"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { SentryRollupPluginOptions } from \"@sentry/rollup-plugin\";\nimport { _rollupPluginInternal } from \"@sentry/rollup-plugin\";\nimport { createRequire } from \"node:module\";\nimport { Plugin } from \"vite\";\n\nfunction getViteMajorVersion(): string | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Rollup already transpiles this for us\n const req = createRequire(import.meta.url);\n const vite = req(\"vite\") as { version?: string };\n return vite.version?.split(\".\")[0];\n } catch (err) {\n // do nothing, we'll just not report a version\n }\n\n return undefined;\n}\n\nexport const sentryVitePlugin = (options?: SentryRollupPluginOptions): Plugin[] => {\n return [\n {\n enforce: \"pre\",\n ..._rollupPluginInternal(options, \"vite\", getViteMajorVersion()),\n },\n ];\n};\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"mappings":";;;;;;AAKA,SAAS,sBAA0C;AACjD,KAAI;AAKF,sFAF0C,CACzB,OAAO,CACZ,SAAS,MAAM,IAAI,CAAC;UACzB,KAAK;;AAOhB,MAAa,oBAAoB,YAAkD;AACjF,QAAO,CACL;EACE,SAAS;EACT,oDAAyB,SAAS,QAAQ,qBAAqB,CAAC;EACjE,CACF"}
@@ -1,61 +1,20 @@
1
- import { sentryUnpluginFactory, createRollupInjectionHooks, createComponentNameAnnotateHooks, createRollupDebugIdUploadHooks, createRollupBundleSizeOptimizationHooks } from '@sentry/bundler-plugin-core';
2
- export { sentryCliBinaryExists } from '@sentry/bundler-plugin-core';
3
- import { createRequire } from 'node:module';
1
+ import { createRequire } from "node:module";
2
+ import { _rollupPluginInternal } from "@sentry/rollup-plugin";
3
+ import { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
4
4
 
5
- function viteInjectionPlugin(injectionCode, debugIds) {
6
- return {
7
- name: "sentry-vite-injection-plugin",
8
- // run `post` to avoid tripping up @rollup/plugin-commonjs when cjs is used
9
- // as we inject an `import` statement
10
- enforce: "post",
11
- // need this so that vite runs the resolveId hook
12
- vite: createRollupInjectionHooks(injectionCode, debugIds)
13
- };
14
- }
15
- function viteComponentNameAnnotatePlugin(ignoredComponents, injectIntoHtml) {
16
- return {
17
- name: "sentry-vite-component-name-annotate-plugin",
18
- enforce: "pre",
19
- vite: createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml)
20
- };
21
- }
22
- function viteDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts) {
23
- return {
24
- name: "sentry-vite-debug-id-upload-plugin",
25
- vite: createRollupDebugIdUploadHooks(upload, logger, createDependencyOnBuildArtifacts)
26
- };
27
- }
28
- function viteBundleSizeOptimizationsPlugin(replacementValues) {
29
- return {
30
- name: "sentry-vite-bundle-size-optimizations-plugin",
31
- vite: createRollupBundleSizeOptimizationHooks(replacementValues)
32
- };
33
- }
5
+ //#region src/index.ts
34
6
  function getViteMajorVersion() {
35
- try {
36
- var _vite$version;
37
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
38
- // @ts-ignore - Rollup already transpiles this for us
39
- var req = createRequire(import.meta.url);
40
- var vite = req("vite");
41
- return (_vite$version = vite.version) === null || _vite$version === void 0 ? void 0 : _vite$version.split(".")[0];
42
- } catch (err) {
43
- // do nothing, we'll just not report a version
44
- }
45
- return undefined;
7
+ try {
8
+ return createRequire(import.meta.url)("vite").version?.split(".")[0];
9
+ } catch (err) {}
46
10
  }
47
- var sentryUnplugin = sentryUnpluginFactory({
48
- injectionPlugin: viteInjectionPlugin,
49
- componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,
50
- debugIdUploadPlugin: viteDebugIdUploadPlugin,
51
- bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,
52
- getBundlerMajorVersion: getViteMajorVersion
53
- });
54
- var sentryVitePlugin = function sentryVitePlugin(options) {
55
- var result = sentryUnplugin.vite(options);
56
- // unplugin returns a single plugin instead of an array when only one plugin is created, so we normalize this here.
57
- return Array.isArray(result) ? result : [result];
11
+ const sentryVitePlugin = (options) => {
12
+ return [{
13
+ enforce: "pre",
14
+ ..._rollupPluginInternal(options, "vite", getViteMajorVersion())
15
+ }];
58
16
  };
59
17
 
60
- export { sentryVitePlugin };
61
- //# sourceMappingURL=index.mjs.map
18
+ //#endregion
19
+ export { sentryCliBinaryExists, sentryVitePlugin };
20
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n CodeInjection,\n sentryUnpluginFactory,\n Options,\n createRollupInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport { createRequire } from \"node:module\";\nimport { UnpluginOptions, VitePlugin } from \"unplugin\";\n\nfunction viteInjectionPlugin(injectionCode: CodeInjection, debugIds: boolean): UnpluginOptions {\n return {\n name: \"sentry-vite-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: createRollupInjectionHooks(injectionCode, debugIds),\n };\n}\n\nfunction viteComponentNameAnnotatePlugin(\n ignoredComponents: string[],\n injectIntoHtml: boolean\n): UnpluginOptions {\n return {\n name: \"sentry-vite-component-name-annotate-plugin\",\n enforce: \"pre\" as const,\n vite: createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml),\n };\n}\n\nfunction viteDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>,\n logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void\n): UnpluginOptions {\n return {\n name: \"sentry-vite-debug-id-upload-plugin\",\n vite: createRollupDebugIdUploadHooks(upload, logger, createDependencyOnBuildArtifacts),\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\nfunction getViteMajorVersion(): string | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Rollup already transpiles this for us\n const req = createRequire(import.meta.url);\n const vite = req(\"vite\") as { version?: string };\n return vite.version?.split(\".\")[0];\n } catch (err) {\n // do nothing, we'll just not report a version\n }\n\n return undefined;\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n injectionPlugin: viteInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\n getBundlerMajorVersion: getViteMajorVersion,\n});\n\nexport const sentryVitePlugin = (options?: Options): VitePlugin[] => {\n const result = sentryUnplugin.vite(options);\n // unplugin returns a single plugin instead of an array when only one plugin is created, so we normalize this here.\n return Array.isArray(result) ? result : [result];\n};\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["viteInjectionPlugin","injectionCode","debugIds","name","enforce","vite","createRollupInjectionHooks","viteComponentNameAnnotatePlugin","ignoredComponents","injectIntoHtml","createComponentNameAnnotateHooks","viteDebugIdUploadPlugin","upload","logger","createDependencyOnBuildArtifacts","createRollupDebugIdUploadHooks","viteBundleSizeOptimizationsPlugin","replacementValues","createRollupBundleSizeOptimizationHooks","getViteMajorVersion","_vite$version","req","createRequire","import","meta","url","version","split","err","undefined","sentryUnplugin","sentryUnpluginFactory","injectionPlugin","componentNameAnnotatePlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","getBundlerMajorVersion","sentryVitePlugin","options","result","Array","isArray"],"mappings":";;;;AAcA,SAASA,mBAAmBA,CAACC,aAA4B,EAAEC,QAAiB,EAAmB;EAC7F,OAAO;AACLC,IAAAA,IAAI,EAAE,8BAA8B;AACpC;AACA;AACAC,IAAAA,OAAO,EAAE,MAAe;AAAE;AAC1BC,IAAAA,IAAI,EAAEC,0BAA0B,CAACL,aAAa,EAAEC,QAAQ,CAAA;GACzD,CAAA;AACH,CAAA;AAEA,SAASK,+BAA+BA,CACtCC,iBAA2B,EAC3BC,cAAuB,EACN;EACjB,OAAO;AACLN,IAAAA,IAAI,EAAE,4CAA4C;AAClDC,IAAAA,OAAO,EAAE,KAAc;AACvBC,IAAAA,IAAI,EAAEK,gCAAgC,CAACF,iBAAiB,EAAEC,cAAc,CAAA;GACzE,CAAA;AACH,CAAA;AAEA,SAASE,uBAAuBA,CAC9BC,MAAmD,EACnDC,MAAc,EACdC,gCAAkD,EACjC;EACjB,OAAO;AACLX,IAAAA,IAAI,EAAE,oCAAoC;AAC1CE,IAAAA,IAAI,EAAEU,8BAA8B,CAACH,MAAM,EAAEC,MAAM,EAAEC,gCAAgC,CAAA;GACtF,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,SAASE,mBAAmBA,GAAuB;EACjD,IAAI;AAAA,IAAA,IAAAC,aAAA,CAAA;AACF;AACA;IACA,IAAMC,GAAG,GAAGC,aAAa,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAA;AAC1C,IAAA,IAAMpB,IAAI,GAAGgB,GAAG,CAAC,MAAM,CAAyB,CAAA;AAChD,IAAA,OAAA,CAAAD,aAAA,GAAOf,IAAI,CAACqB,OAAO,cAAAN,aAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAZA,aAAA,CAAcO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;GACnC,CAAC,OAAOC,GAAG,EAAE;AACZ;AAAA,GAAA;AAGF,EAAA,OAAOC,SAAS,CAAA;AAClB,CAAA;AAEA,IAAMC,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,eAAe,EAAEhC,mBAAmB;AACpCiC,EAAAA,2BAA2B,EAAE1B,+BAA+B;AAC5D2B,EAAAA,mBAAmB,EAAEvB,uBAAuB;AAC5CwB,EAAAA,6BAA6B,EAAEnB,iCAAiC;AAChEoB,EAAAA,sBAAsB,EAAEjB,mBAAAA;AAC1B,CAAC,CAAC,CAAA;IAEWkB,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,OAAiB,EAAmB;AACnE,EAAA,IAAMC,MAAM,GAAGT,cAAc,CAACzB,IAAI,CAACiC,OAAO,CAAC,CAAA;AAC3C;EACA,OAAOE,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,CAAA;AAClD;;;;"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { SentryRollupPluginOptions } from \"@sentry/rollup-plugin\";\nimport { _rollupPluginInternal } from \"@sentry/rollup-plugin\";\nimport { createRequire } from \"node:module\";\nimport { Plugin } from \"vite\";\n\nfunction getViteMajorVersion(): string | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Rollup already transpiles this for us\n const req = createRequire(import.meta.url);\n const vite = req(\"vite\") as { version?: string };\n return vite.version?.split(\".\")[0];\n } catch (err) {\n // do nothing, we'll just not report a version\n }\n\n return undefined;\n}\n\nexport const sentryVitePlugin = (options?: SentryRollupPluginOptions): Plugin[] => {\n return [\n {\n enforce: \"pre\",\n ..._rollupPluginInternal(options, \"vite\", getViteMajorVersion()),\n },\n ];\n};\n\nexport type { Options as SentryVitePluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"mappings":";;;;;AAKA,SAAS,sBAA0C;AACjD,KAAI;AAKF,SAFY,cAAc,OAAO,KAAK,IAAI,CACzB,OAAO,CACZ,SAAS,MAAM,IAAI,CAAC;UACzB,KAAK;;AAOhB,MAAa,oBAAoB,YAAkD;AACjF,QAAO,CACL;EACE,SAAS;EACT,GAAG,sBAAsB,SAAS,QAAQ,qBAAqB,CAAC;EACjE,CACF"}
@@ -1,5 +1,5 @@
1
- import { Options } from "@sentry/bundler-plugin-core";
2
- import { VitePlugin } from "unplugin";
3
- export declare const sentryVitePlugin: (options?: Options) => VitePlugin[];
1
+ import { SentryRollupPluginOptions } from "@sentry/rollup-plugin";
2
+ import { Plugin } from "vite";
3
+ export declare const sentryVitePlugin: (options?: SentryRollupPluginOptions) => Plugin[];
4
4
  export type { Options as SentryVitePluginOptions } from "@sentry/bundler-plugin-core";
5
5
  export { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/vite-plugin",
3
- "version": "4.9.1",
3
+ "version": "5.1.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",
@@ -31,8 +31,8 @@
31
31
  "scripts": {
32
32
  "build": "premove ./out && run-p build:rollup build:types",
33
33
  "build:watch": "run-p build:rollup:watch build:types:watch",
34
- "build:rollup": "rollup --config rollup.config.js",
35
- "build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen",
34
+ "build:rollup": "rolldown --config rollup.config.mjs",
35
+ "build:rollup:watch": "rolldown --config rollup.config.mjs --watch --no-watch.clearScreen",
36
36
  "build:types": "tsc --project types.tsconfig.json",
37
37
  "build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput",
38
38
  "build:npm": "npm pack",
@@ -48,17 +48,12 @@
48
48
  "prepack": "ts-node ./src/prepack.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@sentry/bundler-plugin-core": "4.9.1",
52
- "unplugin": "1.0.1"
51
+ "@sentry/bundler-plugin-core": "5.1.0",
52
+ "@sentry/rollup-plugin": "5.1.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@babel/core": "7.18.5",
56
- "@babel/preset-env": "7.18.2",
57
- "@babel/preset-typescript": "7.17.12",
58
- "@rollup/plugin-babel": "5.3.1",
59
- "@rollup/plugin-node-resolve": "13.3.0",
60
- "@sentry-internal/eslint-config": "4.9.1",
61
- "@sentry-internal/sentry-bundler-plugin-tsconfig": "4.9.1",
55
+ "@sentry-internal/eslint-config": "5.1.0",
56
+ "@sentry-internal/sentry-bundler-plugin-tsconfig": "5.1.0",
62
57
  "@swc/core": "^1.2.205",
63
58
  "@swc/jest": "^0.2.21",
64
59
  "@types/jest": "^28.1.3",
@@ -66,7 +61,7 @@
66
61
  "eslint": "^8.18.0",
67
62
  "jest": "^28.1.1",
68
63
  "premove": "^4.0.0",
69
- "rollup": "2.75.7",
64
+ "rolldown": "^1.0.0-rc.4",
70
65
  "ts-node": "^10.9.1",
71
66
  "typescript": "^4.7.4"
72
67
  },