@sentry/vite-plugin 4.9.0 → 5.0.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 +19 -45
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +16 -42
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/package.json +8 -13
package/dist/cjs/index.js
CHANGED
|
@@ -1,53 +1,27 @@
|
|
|
1
|
-
'
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
name: "sentry-vite-injection-plugin",
|
|
10
|
-
// run `post` to avoid tripping up @rollup/plugin-commonjs when cjs is used
|
|
11
|
-
// as we inject an `import` statement
|
|
12
|
-
enforce: "post",
|
|
13
|
-
// need this so that vite runs the resolveId hook
|
|
14
|
-
vite: bundlerPluginCore.createRollupInjectionHooks(injectionCode, debugIds)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function viteComponentNameAnnotatePlugin(ignoredComponents, injectIntoHtml) {
|
|
18
|
-
return {
|
|
19
|
-
name: "sentry-vite-component-name-annotate-plugin",
|
|
20
|
-
enforce: "pre",
|
|
21
|
-
vite: bundlerPluginCore.createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml)
|
|
22
|
-
};
|
|
6
|
+
//#region src/index.ts
|
|
7
|
+
function getViteMajorVersion() {
|
|
8
|
+
try {
|
|
9
|
+
return (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("vite").version?.split(".")[0];
|
|
10
|
+
} catch (err) {}
|
|
23
11
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
function viteBundleSizeOptimizationsPlugin(replacementValues) {
|
|
31
|
-
return {
|
|
32
|
-
name: "sentry-vite-bundle-size-optimizations-plugin",
|
|
33
|
-
vite: bundlerPluginCore.createRollupBundleSizeOptimizationHooks(replacementValues)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
var sentryUnplugin = bundlerPluginCore.sentryUnpluginFactory({
|
|
37
|
-
injectionPlugin: viteInjectionPlugin,
|
|
38
|
-
componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,
|
|
39
|
-
debugIdUploadPlugin: viteDebugIdUploadPlugin,
|
|
40
|
-
bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin
|
|
41
|
-
});
|
|
42
|
-
var sentryVitePlugin = function sentryVitePlugin(options) {
|
|
43
|
-
var result = sentryUnplugin.vite(options);
|
|
44
|
-
// unplugin returns a single plugin instead of an array when only one plugin is created, so we normalize this here.
|
|
45
|
-
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
|
+
}];
|
|
46
17
|
};
|
|
47
18
|
|
|
19
|
+
//#endregion
|
|
48
20
|
Object.defineProperty(exports, 'sentryCliBinaryExists', {
|
|
49
21
|
enumerable: true,
|
|
50
|
-
get: function () {
|
|
22
|
+
get: function () {
|
|
23
|
+
return _sentry_bundler_plugin_core.sentryCliBinaryExists;
|
|
24
|
+
}
|
|
51
25
|
});
|
|
52
26
|
exports.sentryVitePlugin = sentryVitePlugin;
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\
|
|
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"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,46 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { _rollupPluginInternal } from "@sentry/rollup-plugin";
|
|
3
|
+
import { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
enforce: "post",
|
|
10
|
-
// need this so that vite runs the resolveId hook
|
|
11
|
-
vite: createRollupInjectionHooks(injectionCode, debugIds)
|
|
12
|
-
};
|
|
5
|
+
//#region src/index.ts
|
|
6
|
+
function getViteMajorVersion() {
|
|
7
|
+
try {
|
|
8
|
+
return createRequire(import.meta.url)("vite").version?.split(".")[0];
|
|
9
|
+
} catch (err) {}
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function viteDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts) {
|
|
22
|
-
return {
|
|
23
|
-
name: "sentry-vite-debug-id-upload-plugin",
|
|
24
|
-
vite: createRollupDebugIdUploadHooks(upload, logger, createDependencyOnBuildArtifacts)
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function viteBundleSizeOptimizationsPlugin(replacementValues) {
|
|
28
|
-
return {
|
|
29
|
-
name: "sentry-vite-bundle-size-optimizations-plugin",
|
|
30
|
-
vite: createRollupBundleSizeOptimizationHooks(replacementValues)
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
var sentryUnplugin = sentryUnpluginFactory({
|
|
34
|
-
injectionPlugin: viteInjectionPlugin,
|
|
35
|
-
componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,
|
|
36
|
-
debugIdUploadPlugin: viteDebugIdUploadPlugin,
|
|
37
|
-
bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin
|
|
38
|
-
});
|
|
39
|
-
var sentryVitePlugin = function sentryVitePlugin(options) {
|
|
40
|
-
var result = sentryUnplugin.vite(options);
|
|
41
|
-
// unplugin returns a single plugin instead of an array when only one plugin is created, so we normalize this here.
|
|
42
|
-
return Array.isArray(result) ? result : [result];
|
|
11
|
+
const sentryVitePlugin = (options) => {
|
|
12
|
+
return [{
|
|
13
|
+
enforce: "pre",
|
|
14
|
+
..._rollupPluginInternal(options, "vite", getViteMajorVersion())
|
|
15
|
+
}];
|
|
43
16
|
};
|
|
44
17
|
|
|
45
|
-
|
|
46
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
export { sentryCliBinaryExists, sentryVitePlugin };
|
|
20
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\
|
|
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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const sentryVitePlugin: (options?:
|
|
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": "
|
|
3
|
+
"version": "5.0.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": "
|
|
35
|
-
"build:rollup:watch": "
|
|
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": "
|
|
52
|
-
"
|
|
51
|
+
"@sentry/bundler-plugin-core": "5.0.0",
|
|
52
|
+
"@sentry/rollup-plugin": "5.0.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
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.0",
|
|
61
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.9.0",
|
|
55
|
+
"@sentry-internal/eslint-config": "5.0.0",
|
|
56
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "5.0.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
|
-
"
|
|
64
|
+
"rolldown": "^1.0.0-rc.4",
|
|
70
65
|
"ts-node": "^10.9.1",
|
|
71
66
|
"typescript": "^4.7.4"
|
|
72
67
|
},
|