@sentry/vite-plugin 4.7.0 → 4.8.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 +7 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -128,6 +128,7 @@ SENTRY_PROJECT=frontend-team-a,frontend-team-b,frontend-team-c
|
|
|
128
128
|
- [`reactComponentAnnotation`](#reactcomponentannotation)
|
|
129
129
|
- [`enabled`](#reactcomponentannotationenabled)
|
|
130
130
|
- [`ignoredComponents`](#reactcomponentannotationignoredcomponents)
|
|
131
|
+
- [`_experimentalInjectIntoHtml`](#reactcomponentannotation_experimentalinjectintohtml)
|
|
131
132
|
- [`moduleMetadata`](#modulemetadata)
|
|
132
133
|
- [`applicationKey`](#applicationkey)
|
|
133
134
|
- [`_experiments`](#_experiments)
|
|
@@ -668,6 +669,12 @@ Type: `string[]`
|
|
|
668
669
|
|
|
669
670
|
A list of strings representing the names of components to ignore. The plugin will not perform apply `data-sentry` annotations on the DOM element for these components.
|
|
670
671
|
|
|
672
|
+
### `reactComponentAnnotation._experimentalInjectIntoHtml`
|
|
673
|
+
|
|
674
|
+
Type: `boolean`
|
|
675
|
+
|
|
676
|
+
An experimental component annotation injection mode that injects annotations into HTML rather than React components.
|
|
677
|
+
|
|
671
678
|
### `moduleMetadata`
|
|
672
679
|
|
|
673
680
|
Type: `Record<string, any> | (args: { org?: string; project?: string; release?: string; }) => Record<string, any>`
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,11 +14,11 @@ function viteInjectionPlugin(injectionCode, debugIds) {
|
|
|
14
14
|
vite: bundlerPluginCore.createRollupInjectionHooks(injectionCode, debugIds)
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function viteComponentNameAnnotatePlugin(ignoredComponents) {
|
|
17
|
+
function viteComponentNameAnnotatePlugin(ignoredComponents, injectIntoHtml) {
|
|
18
18
|
return {
|
|
19
19
|
name: "sentry-vite-component-name-annotate-plugin",
|
|
20
20
|
enforce: "pre",
|
|
21
|
-
vite: bundlerPluginCore.createComponentNameAnnotateHooks(ignoredComponents)
|
|
21
|
+
vite: bundlerPluginCore.createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
function viteDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts) {
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions, VitePlugin } from \"unplugin\";\n\nfunction viteInjectionPlugin(injectionCode:
|
|
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 { 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\nconst sentryUnplugin = sentryUnpluginFactory({\n injectionPlugin: viteInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\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","sentryUnplugin","sentryUnpluginFactory","injectionPlugin","componentNameAnnotatePlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryVitePlugin","options","result","Array","isArray"],"mappings":";;;;;;A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OE,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,CAAA;AAClD;;;;;;;;"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -11,11 +11,11 @@ function viteInjectionPlugin(injectionCode, debugIds) {
|
|
|
11
11
|
vite: createRollupInjectionHooks(injectionCode, debugIds)
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function viteComponentNameAnnotatePlugin(ignoredComponents) {
|
|
14
|
+
function viteComponentNameAnnotatePlugin(ignoredComponents, injectIntoHtml) {
|
|
15
15
|
return {
|
|
16
16
|
name: "sentry-vite-component-name-annotate-plugin",
|
|
17
17
|
enforce: "pre",
|
|
18
|
-
vite: createComponentNameAnnotateHooks(ignoredComponents)
|
|
18
|
+
vite: createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml)
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
function viteDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts) {
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n createRollupInjectionHooks,\n createRollupDebugIdUploadHooks,\n SentrySDKBuildFlags,\n createRollupBundleSizeOptimizationHooks,\n createComponentNameAnnotateHooks,\n Logger,\n} from \"@sentry/bundler-plugin-core\";\nimport { UnpluginOptions, VitePlugin } from \"unplugin\";\n\nfunction viteInjectionPlugin(injectionCode:
|
|
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 { 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\nconst sentryUnplugin = sentryUnpluginFactory({\n injectionPlugin: viteInjectionPlugin,\n componentNameAnnotatePlugin: viteComponentNameAnnotatePlugin,\n debugIdUploadPlugin: viteDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: viteBundleSizeOptimizationsPlugin,\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","sentryUnplugin","sentryUnpluginFactory","injectionPlugin","componentNameAnnotatePlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryVitePlugin","options","result","Array","isArray"],"mappings":";;;AAaA,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,IAAME,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,eAAe,EAAErB,mBAAmB;AACpCsB,EAAAA,2BAA2B,EAAEf,+BAA+B;AAC5DgB,EAAAA,mBAAmB,EAAEZ,uBAAuB;AAC5Ca,EAAAA,6BAA6B,EAAER,iCAAAA;AACjC,CAAC,CAAC,CAAA;IAEWS,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,OAAiB,EAAmB;AACnE,EAAA,IAAMC,MAAM,GAAGR,cAAc,CAACd,IAAI,CAACqB,OAAO,CAAC,CAAA;AAC3C;EACA,OAAOE,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,CAAA;AAClD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/vite-plugin",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.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": "4.
|
|
51
|
+
"@sentry/bundler-plugin-core": "4.8.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": "4.
|
|
61
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.
|
|
60
|
+
"@sentry-internal/eslint-config": "4.8.0",
|
|
61
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.8.0",
|
|
62
62
|
"@swc/core": "^1.2.205",
|
|
63
63
|
"@swc/jest": "^0.2.21",
|
|
64
64
|
"@types/jest": "^28.1.3",
|