@sentry/vite-plugin 4.9.1 → 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 +18 -59
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +15 -56
- 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,68 +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
|
-
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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 () {
|
|
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
|
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,61 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { _rollupPluginInternal } from "@sentry/rollup-plugin";
|
|
3
|
+
import { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
61
|
-
|
|
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.1",
|
|
61
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.9.1",
|
|
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
|
},
|