@sentry/vite-plugin 5.1.0 → 5.2.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
@@ -253,10 +253,12 @@ Default: `[]`
253
253
 
254
254
  ### `sourcemaps.rewriteSources`
255
255
 
256
- Type: `(source: string, map: any) => string`
256
+ Type: `(source: string, map: any, context?: { mapDir: string }) => string`
257
257
 
258
258
  Hook to rewrite the `sources` field inside the source map before being uploaded to Sentry. Does not modify the actual source map. Effectively, this modifies how files inside the stacktrace will show up in Sentry.
259
259
 
260
+ The `context.mapDir` parameter provides the directory path of the source map file, which is useful for resolving relative source paths (e.g. `path.resolve(context.mapDir, source)`).
261
+
260
262
  Defaults to making all sources relative to `process.cwd()` while building.
261
263
 
262
264
  ### `sourcemaps.resolveSourceMap`
package/dist/cjs/index.js CHANGED
@@ -1,8 +1,7 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _sentry_rollup_plugin = require("@sentry/rollup-plugin");
3
3
  let node_module = require("node:module");
4
4
  let _sentry_bundler_plugin_core = require("@sentry/bundler-plugin-core");
5
-
6
5
  //#region src/index.ts
7
6
  function getViteMajorVersion() {
8
7
  try {
@@ -15,13 +14,13 @@ const sentryVitePlugin = (options) => {
15
14
  ...(0, _sentry_rollup_plugin._rollupPluginInternal)(options, "vite", getViteMajorVersion())
16
15
  }];
17
16
  };
18
-
19
17
  //#endregion
20
- Object.defineProperty(exports, 'sentryCliBinaryExists', {
21
- enumerable: true,
22
- get: function () {
23
- return _sentry_bundler_plugin_core.sentryCliBinaryExists;
24
- }
18
+ Object.defineProperty(exports, "sentryCliBinaryExists", {
19
+ enumerable: true,
20
+ get: function() {
21
+ return _sentry_bundler_plugin_core.sentryCliBinaryExists;
22
+ }
25
23
  });
26
24
  exports.sentryVitePlugin = sentryVitePlugin;
25
+
27
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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
+ {"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()) as Plugin),\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,UAAA,GAAA,YAAA,eAAA,QAAA,MAAA,CAAA,cAAA,WAAA,CAAA,KAF0C,CACzB,OAAO,CACZ,SAAS,MAAM,IAAI,CAAC;UACzB,KAAK;;AAOhB,MAAa,oBAAoB,YAAkD;AACjF,QAAO,CACL;EACE,SAAS;EACT,IAAA,GAAA,sBAAA,uBAA0B,SAAS,QAAQ,qBAAqB,CAAC;EAClE,CACF"}
@@ -1,7 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { _rollupPluginInternal } from "@sentry/rollup-plugin";
3
3
  import { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
4
-
5
4
  //#region src/index.ts
6
5
  function getViteMajorVersion() {
7
6
  try {
@@ -14,7 +13,7 @@ const sentryVitePlugin = (options) => {
14
13
  ..._rollupPluginInternal(options, "vite", getViteMajorVersion())
15
14
  }];
16
15
  };
17
-
18
16
  //#endregion
19
17
  export { sentryCliBinaryExists, sentryVitePlugin };
18
+
20
19
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
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
+ {"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()) as Plugin),\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,GAAI,sBAAsB,SAAS,QAAQ,qBAAqB,CAAC;EAClE,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/vite-plugin",
3
- "version": "5.1.0",
3
+ "version": "5.2.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",
@@ -29,7 +29,7 @@
29
29
  "module": "dist/esm/index.mjs",
30
30
  "types": "dist/types/index.d.ts",
31
31
  "scripts": {
32
- "build": "premove ./out && run-p build:rollup build:types",
32
+ "build": "premove ./out && run-p build:rollup build:types && run-s build:npm",
33
33
  "build:watch": "run-p build:rollup:watch build:types:watch",
34
34
  "build:rollup": "rolldown --config rollup.config.mjs",
35
35
  "build:rollup:watch": "rolldown --config rollup.config.mjs --watch --no-watch.clearScreen",
@@ -43,25 +43,22 @@
43
43
  "clean:all": "run-p clean clean:deps",
44
44
  "clean:build": "premove ./dist *.tgz",
45
45
  "clean:deps": "premove node_modules",
46
- "test": "jest",
46
+ "test": "vitest run",
47
47
  "lint": "eslint ./src ./test",
48
48
  "prepack": "ts-node ./src/prepack.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@sentry/bundler-plugin-core": "5.1.0",
52
- "@sentry/rollup-plugin": "5.1.0"
51
+ "@sentry/bundler-plugin-core": "5.2.0",
52
+ "@sentry/rollup-plugin": "5.2.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@sentry-internal/eslint-config": "5.1.0",
56
- "@sentry-internal/sentry-bundler-plugin-tsconfig": "5.1.0",
57
- "@swc/core": "^1.2.205",
58
- "@swc/jest": "^0.2.21",
59
- "@types/jest": "^28.1.3",
55
+ "@sentry-internal/eslint-config": "5.2.0",
56
+ "@sentry-internal/sentry-bundler-plugin-tsconfig": "5.2.0",
60
57
  "@types/node": "^18.6.3",
61
58
  "eslint": "^8.18.0",
62
- "jest": "^28.1.1",
59
+ "vitest": "^4.0.0",
63
60
  "premove": "^4.0.0",
64
- "rolldown": "^1.0.0-rc.4",
61
+ "rolldown": "1.0.0-rc.10",
65
62
  "ts-node": "^10.9.1",
66
63
  "typescript": "^4.7.4"
67
64
  },
@@ -69,6 +66,6 @@
69
66
  "extends": "../../package.json"
70
67
  },
71
68
  "engines": {
72
- "node": ">= 14"
69
+ "node": ">= 18"
73
70
  }
74
71
  }