@sentry/esbuild-plugin 2.16.1 → 2.18.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 +27 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +4 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ yarn add @sentry/esbuild-plugin --dev
|
|
|
29
29
|
Using pnpm:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
pnpm
|
|
32
|
+
pnpm add @sentry/esbuild-plugin --save-dev
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
## Example
|
|
@@ -82,6 +82,8 @@ require("esbuild").build({
|
|
|
82
82
|
- [`cleanArtifacts`](#releasecleanartifacts)
|
|
83
83
|
- [`uploadLegacySourcemaps`](#releaseuploadlegacysourcemaps)
|
|
84
84
|
|
|
85
|
+
- [`moduleMetadata`](#modulemetadata)
|
|
86
|
+
- [`applicationKey`](#applicationkey)
|
|
85
87
|
- [`_experiments`](#_experiments)
|
|
86
88
|
- [`injectBuildInformation`](#_experimentsinjectbuildinformation)
|
|
87
89
|
|
|
@@ -380,6 +382,8 @@ Remove all previously uploaded artifacts for this release on Sentry before the u
|
|
|
380
382
|
|
|
381
383
|
Defaults to `false`.
|
|
382
384
|
|
|
385
|
+
**Deprecation Notice:** `cleanArtifacts` is deprecated and will does currently not do anything. Historically it was needed since uploading the same artifacts twice was not allowed. Nowadays, when uploading artifacts with the same name more than once to the same release on Sentry, Sentry will prefer the most recent artifact for source mapping.
|
|
386
|
+
|
|
383
387
|
### `release.uploadLegacySourcemaps`
|
|
384
388
|
|
|
385
389
|
Type: `string | IncludeEntry | Array<string | IncludeEntry>`
|
|
@@ -392,6 +396,8 @@ Each path can be given as a string or an object with more specific options.
|
|
|
392
396
|
The modern version of doing source maps upload is more robust and way easier to get working but has to inject a very small snippet of JavaScript into your output bundles.
|
|
393
397
|
In situations where this leads to problems (e.g subresource integrity) you can use this option as a fallback.
|
|
394
398
|
|
|
399
|
+
Please note that this option will not interact with any settings provided in the `sourcemaps` option. Using `uploadLegacySourcemaps` is a completely separate upload mechanism we provide for backwards-compatibility.
|
|
400
|
+
|
|
395
401
|
The `IncludeEntry` type looks as follows:
|
|
396
402
|
|
|
397
403
|
```ts
|
|
@@ -481,6 +487,26 @@ type IncludeEntry = {
|
|
|
481
487
|
|
|
482
488
|
|
|
483
489
|
|
|
490
|
+
### `moduleMetadata`
|
|
491
|
+
|
|
492
|
+
Type: `Record<string, any> | (args: { org?: string; project?: string; release?: string; }) => Record<string, any>`
|
|
493
|
+
|
|
494
|
+
Metadata that should be associated with the built application.
|
|
495
|
+
|
|
496
|
+
The metadata is serialized and can be looked up at runtime from within the SDK (for example in the `beforeSend`, event processors, or the transport), allowing for custom event filtering logic or routing of events.
|
|
497
|
+
|
|
498
|
+
Metadata can either be passed directly or alternatively a callback can be provided that will be called with the following parameters:
|
|
499
|
+
|
|
500
|
+
- `org`: The organization slug.
|
|
501
|
+
- `project`: The project slug.
|
|
502
|
+
- `release`: The release name.
|
|
503
|
+
|
|
504
|
+
### `applicationKey`
|
|
505
|
+
|
|
506
|
+
Type: `string`
|
|
507
|
+
|
|
508
|
+
A key which will embedded in all the bundled files. The SDK will be able to use the key to apply filtering rules, for example using the `thirdPartyErrorFilterIntegration`.
|
|
509
|
+
|
|
484
510
|
### `_experiments`
|
|
485
511
|
|
|
486
512
|
Type: `string`
|
package/dist/cjs/index.js
CHANGED
|
@@ -491,7 +491,7 @@ function esbuildReleaseInjectionPlugin(injectionCode) {
|
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
|
-
function esbuildDebugIdInjectionPlugin() {
|
|
494
|
+
function esbuildDebugIdInjectionPlugin(logger) {
|
|
495
495
|
var pluginName = "sentry-esbuild-debug-id-injection-plugin";
|
|
496
496
|
var stubNamespace = "sentry-debug-id-stub";
|
|
497
497
|
return {
|
|
@@ -501,6 +501,9 @@ function esbuildDebugIdInjectionPlugin() {
|
|
|
501
501
|
var initialOptions = _ref2.initialOptions,
|
|
502
502
|
onLoad = _ref2.onLoad,
|
|
503
503
|
onResolve = _ref2.onResolve;
|
|
504
|
+
if (!initialOptions.bundle) {
|
|
505
|
+
logger.warn("The Sentry esbuild plugin only supports esbuild with `bundle: true` being set in the esbuild build options. Esbuild will probably crash now. Sorry about that. If you need to upload sourcemaps without `bundle: true`, it is recommended to use Sentry CLI instead: https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/");
|
|
506
|
+
}
|
|
504
507
|
onResolve({
|
|
505
508
|
filter: /.*/
|
|
506
509
|
}, function (args) {
|
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 getDebugIdSnippet,\n SentrySDKBuildFlags,\n} from \"@sentry/bundler-plugin-core\";\nimport type { UnpluginOptions } from \"unplugin\";\nimport * as path from \"path\";\n\nimport { v4 as uuidv4 } from \"uuid\";\n\nfunction esbuildReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-release-injection-plugin\";\n const virtualReleaseInjectionFilePath = path.resolve(\"_sentry-release-injection-stub\"); // needs to be an absolute path for older eslint versions\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n initialOptions.inject = initialOptions.inject || [];\n initialOptions.inject.push(virtualReleaseInjectionFilePath);\n\n onResolve({ filter: /_sentry-release-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n };\n });\n\n onLoad({ filter: /_sentry-release-injection-stub/ }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n });\n },\n },\n };\n}\n\nfunction esbuildDebugIdInjectionPlugin(): UnpluginOptions {\n const pluginName = \"sentry-esbuild-debug-id-injection-plugin\";\n const stubNamespace = \"sentry-debug-id-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-debug-id-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-debug-id-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad({ filter: /_sentry-debug-id-injection-stub/, namespace: stubNamespace }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: getDebugIdSnippet(uuidv4()),\n };\n });\n },\n },\n };\n}\n\nfunction esbuildModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-module-metadata-injection-plugin\";\n const stubNamespace = \"sentry-module-metadata-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isMetadataProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryMetadataProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isMetadataProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-module-metadata-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-module-metadata-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad(\n { filter: /_sentry-module-metadata-injection-stub/, namespace: stubNamespace },\n () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n }\n );\n },\n },\n };\n}\n\nfunction esbuildDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-debug-id-upload-plugin\",\n esbuild: {\n setup({ initialOptions, onEnd }) {\n initialOptions.metafile = true;\n onEnd(async (result) => {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n });\n },\n },\n };\n}\n\nfunction esbuildBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-bundle-size-optimizations-plugin\",\n esbuild: {\n setup({ initialOptions }) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n initialOptions.define = { ...initialOptions.define, ...replacementStringValues };\n },\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: esbuildReleaseInjectionPlugin,\n debugIdInjectionPlugin: esbuildDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: esbuildModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: esbuildDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: esbuildBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryEsbuildPlugin: (options?: Options) => any = sentryUnplugin.esbuild;\n\nexport type { Options as SentryEsbuildPluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["esbuildReleaseInjectionPlugin","injectionCode","pluginName","virtualReleaseInjectionFilePath","path","resolve","name","esbuild","setup","_ref","initialOptions","onLoad","onResolve","inject","push","filter","args","sideEffects","loader","contents","esbuildDebugIdInjectionPlugin","stubNamespace","_ref2","kind","_initialOptions$injec","includes","isAbsolute","join","resolveDir","pluginData","isProxyResolver","originalPath","originalResolveDir","suffix","_args$pluginData","concat","JSON","stringify","namespace","uuidv4","getDebugIdSnippet","esbuildModuleMetadataInjectionPlugin","_ref3","_initialOptions$injec2","isMetadataProxyResolver","_args$pluginData2","esbuildDebugIdUploadPlugin","upload","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","buildArtifacts","wrap","_callee$","_context","prev","next","Object","keys","outputs","stop","_x","apply","arguments","esbuildBundleSizeOptimizationsPlugin","replacementValues","_ref6","replacementStringValues","entries","forEach","_ref7","_ref8","_slicedToArray","key","value","define","_objectSpread","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryEsbuildPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;AAAhBG,YAAAA,GAAG,GAAAF,KAAA,CAAA,CAAA,CAAA;AAAEG,YAAAA,KAAK,GAAAH,KAAA,CAAA,CAAA,CAAA,CAAA;UACpDJ,uBAAuB,CAACM,GAAG,CAAC,GAAG3C,IAAI,CAACC,SAAS,CAAC2C,KAAK,CAAC,CAAA;AACtD,SAAC,CAAC,CAAA;AAEFtE,QAAAA,cAAc,CAACuE,MAAM,GAAAC,cAAA,CAAAA,cAAA,CAAQxE,EAAAA,EAAAA,cAAc,CAACuE,MAAM,CAAKR,EAAAA,uBAAuB,CAAE,CAAA;AAClF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMU,cAAc,GAAGC,uCAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAErF,6BAA6B;AACrDsF,EAAAA,sBAAsB,EAAElE,6BAA6B;AACrDmE,EAAAA,6BAA6B,EAAE9C,oCAAoC;AACnE+C,EAAAA,mBAAmB,EAAE1C,0BAA0B;AAC/C2C,EAAAA,6BAA6B,EAAEnB,oCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaoB,IAAAA,mBAA+C,GAAGP,cAAc,CAAC5E;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import {\n sentryUnpluginFactory,\n Options,\n getDebugIdSnippet,\n SentrySDKBuildFlags,\n} from \"@sentry/bundler-plugin-core\";\nimport type { Logger } from \"@sentry/bundler-plugin-core\";\nimport type { UnpluginOptions } from \"unplugin\";\nimport * as path from \"path\";\n\nimport { v4 as uuidv4 } from \"uuid\";\n\nfunction esbuildReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-release-injection-plugin\";\n const virtualReleaseInjectionFilePath = path.resolve(\"_sentry-release-injection-stub\"); // needs to be an absolute path for older eslint versions\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n initialOptions.inject = initialOptions.inject || [];\n initialOptions.inject.push(virtualReleaseInjectionFilePath);\n\n onResolve({ filter: /_sentry-release-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n };\n });\n\n onLoad({ filter: /_sentry-release-injection-stub/ }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n });\n },\n },\n };\n}\n\nfunction esbuildDebugIdInjectionPlugin(logger: Logger): UnpluginOptions {\n const pluginName = \"sentry-esbuild-debug-id-injection-plugin\";\n const stubNamespace = \"sentry-debug-id-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n if (!initialOptions.bundle) {\n logger.warn(\n \"The Sentry esbuild plugin only supports esbuild with `bundle: true` being set in the esbuild build options. Esbuild will probably crash now. Sorry about that. If you need to upload sourcemaps without `bundle: true`, it is recommended to use Sentry CLI instead: https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/\"\n );\n }\n\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-debug-id-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-debug-id-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad({ filter: /_sentry-debug-id-injection-stub/, namespace: stubNamespace }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: getDebugIdSnippet(uuidv4()),\n };\n });\n },\n },\n };\n}\n\nfunction esbuildModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-module-metadata-injection-plugin\";\n const stubNamespace = \"sentry-module-metadata-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isMetadataProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryMetadataProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isMetadataProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-module-metadata-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-module-metadata-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad(\n { filter: /_sentry-module-metadata-injection-stub/, namespace: stubNamespace },\n () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n }\n );\n },\n },\n };\n}\n\nfunction esbuildDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-debug-id-upload-plugin\",\n esbuild: {\n setup({ initialOptions, onEnd }) {\n initialOptions.metafile = true;\n onEnd(async (result) => {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n });\n },\n },\n };\n}\n\nfunction esbuildBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-bundle-size-optimizations-plugin\",\n esbuild: {\n setup({ initialOptions }) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n initialOptions.define = { ...initialOptions.define, ...replacementStringValues };\n },\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: esbuildReleaseInjectionPlugin,\n debugIdInjectionPlugin: esbuildDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: esbuildModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: esbuildDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: esbuildBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryEsbuildPlugin: (options?: Options) => any = sentryUnplugin.esbuild;\n\nexport type { Options as SentryEsbuildPluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["esbuildReleaseInjectionPlugin","injectionCode","pluginName","virtualReleaseInjectionFilePath","path","resolve","name","esbuild","setup","_ref","initialOptions","onLoad","onResolve","inject","push","filter","args","sideEffects","loader","contents","esbuildDebugIdInjectionPlugin","logger","stubNamespace","_ref2","bundle","warn","kind","_initialOptions$injec","includes","isAbsolute","join","resolveDir","pluginData","isProxyResolver","originalPath","originalResolveDir","suffix","_args$pluginData","concat","JSON","stringify","namespace","uuidv4","getDebugIdSnippet","esbuildModuleMetadataInjectionPlugin","_ref3","_initialOptions$injec2","isMetadataProxyResolver","_args$pluginData2","esbuildDebugIdUploadPlugin","upload","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","buildArtifacts","wrap","_callee$","_context","prev","next","Object","keys","outputs","stop","_x","apply","arguments","esbuildBundleSizeOptimizationsPlugin","replacementValues","_ref6","replacementStringValues","entries","forEach","_ref7","_ref8","_slicedToArray","key","value","define","_objectSpread","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryEsbuildPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,6BAA6BA,CAACC,aAAqB,EAAmB;EAC7E,IAAMC,UAAU,GAAG,yCAAyC,CAAA;EAC5D,IAAMC,+BAA+B,GAAGC,eAAI,CAACC,OAAO,CAAC,gCAAgC,CAAC,CAAC;;EAEvF,OAAO;AACLC,IAAAA,IAAI,EAAEJ,UAAU;AAEhBK,IAAAA,OAAO,EAAE;MACPC,KAAK,EAAA,SAAAA,KAAAC,CAAAA,IAAA,EAAwC;AAAA,QAAA,IAArCC,cAAc,GAAAD,IAAA,CAAdC,cAAc;UAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;UAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS,CAAA;AACvCF,QAAAA,cAAc,CAACG,MAAM,GAAG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AAmB,EAAE1C,0BAA0B;AAC/C2C,EAAAA,6BAA6B,EAAEnB,oCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaoB,IAAAA,mBAA+C,GAAGP,cAAc,CAAC/E;;;;;;;;"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -468,7 +468,7 @@ function esbuildReleaseInjectionPlugin(injectionCode) {
|
|
|
468
468
|
}
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
-
function esbuildDebugIdInjectionPlugin() {
|
|
471
|
+
function esbuildDebugIdInjectionPlugin(logger) {
|
|
472
472
|
var pluginName = "sentry-esbuild-debug-id-injection-plugin";
|
|
473
473
|
var stubNamespace = "sentry-debug-id-stub";
|
|
474
474
|
return {
|
|
@@ -478,6 +478,9 @@ function esbuildDebugIdInjectionPlugin() {
|
|
|
478
478
|
var initialOptions = _ref2.initialOptions,
|
|
479
479
|
onLoad = _ref2.onLoad,
|
|
480
480
|
onResolve = _ref2.onResolve;
|
|
481
|
+
if (!initialOptions.bundle) {
|
|
482
|
+
logger.warn("The Sentry esbuild plugin only supports esbuild with `bundle: true` being set in the esbuild build options. Esbuild will probably crash now. Sorry about that. If you need to upload sourcemaps without `bundle: true`, it is recommended to use Sentry CLI instead: https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/");
|
|
483
|
+
}
|
|
481
484
|
onResolve({
|
|
482
485
|
filter: /.*/
|
|
483
486
|
}, function (args) {
|
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 getDebugIdSnippet,\n SentrySDKBuildFlags,\n} from \"@sentry/bundler-plugin-core\";\nimport type { UnpluginOptions } from \"unplugin\";\nimport * as path from \"path\";\n\nimport { v4 as uuidv4 } from \"uuid\";\n\nfunction esbuildReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-release-injection-plugin\";\n const virtualReleaseInjectionFilePath = path.resolve(\"_sentry-release-injection-stub\"); // needs to be an absolute path for older eslint versions\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n initialOptions.inject = initialOptions.inject || [];\n initialOptions.inject.push(virtualReleaseInjectionFilePath);\n\n onResolve({ filter: /_sentry-release-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n };\n });\n\n onLoad({ filter: /_sentry-release-injection-stub/ }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n });\n },\n },\n };\n}\n\nfunction esbuildDebugIdInjectionPlugin(): UnpluginOptions {\n const pluginName = \"sentry-esbuild-debug-id-injection-plugin\";\n const stubNamespace = \"sentry-debug-id-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-debug-id-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-debug-id-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad({ filter: /_sentry-debug-id-injection-stub/, namespace: stubNamespace }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: getDebugIdSnippet(uuidv4()),\n };\n });\n },\n },\n };\n}\n\nfunction esbuildModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-module-metadata-injection-plugin\";\n const stubNamespace = \"sentry-module-metadata-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isMetadataProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryMetadataProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isMetadataProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-module-metadata-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-module-metadata-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad(\n { filter: /_sentry-module-metadata-injection-stub/, namespace: stubNamespace },\n () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n }\n );\n },\n },\n };\n}\n\nfunction esbuildDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-debug-id-upload-plugin\",\n esbuild: {\n setup({ initialOptions, onEnd }) {\n initialOptions.metafile = true;\n onEnd(async (result) => {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n });\n },\n },\n };\n}\n\nfunction esbuildBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-bundle-size-optimizations-plugin\",\n esbuild: {\n setup({ initialOptions }) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n initialOptions.define = { ...initialOptions.define, ...replacementStringValues };\n },\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: esbuildReleaseInjectionPlugin,\n debugIdInjectionPlugin: esbuildDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: esbuildModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: esbuildDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: esbuildBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryEsbuildPlugin: (options?: Options) => any = sentryUnplugin.esbuild;\n\nexport type { Options as SentryEsbuildPluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["esbuildReleaseInjectionPlugin","injectionCode","pluginName","virtualReleaseInjectionFilePath","path","resolve","name","esbuild","setup","_ref","initialOptions","onLoad","onResolve","inject","push","filter","args","sideEffects","loader","contents","esbuildDebugIdInjectionPlugin","stubNamespace","_ref2","kind","_initialOptions$injec","includes","isAbsolute","join","resolveDir","pluginData","isProxyResolver","originalPath","originalResolveDir","suffix","_args$pluginData","concat","JSON","stringify","namespace","uuidv4","getDebugIdSnippet","esbuildModuleMetadataInjectionPlugin","_ref3","_initialOptions$injec2","isMetadataProxyResolver","_args$pluginData2","esbuildDebugIdUploadPlugin","upload","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","buildArtifacts","wrap","_callee$","_context","prev","next","Object","keys","outputs","stop","_x","apply","arguments","esbuildBundleSizeOptimizationsPlugin","replacementValues","_ref6","replacementStringValues","entries","forEach","_ref7","_ref8","_slicedToArray","key","value","define","_objectSpread","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryEsbuildPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAASA,6BAA6BA,CAACC,aAAqB,EAAmB;EAC7E,IAAMC,UAAU,GAAG,yCAAyC,CAAA;EAC5D,IAAMC,+BAA+B,GAAGC,IAAI,CAACC,OAAO,CAAC,gCAAgC,CAAC,CAAC;;EAEvF,OAAO;AACLC,IAAAA,IAAI,EAAEJ,UAAU;AAEhBK,IAAAA,OAAO,EAAE;MACPC,KAAK,EAAA,SAAAA,KAAAC,CAAAA,IAAA,EAAwC;AAAA,QAAA,IAArCC,cAAc,GAAAD,IAAA,CAAdC,cAAc;UAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;UAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS,CAAA;AACvCF,QAAAA,cAAc,CAACG,MAAM,GAAGH,cAAc,CAACG,MAAM,IAAI,EAAE,CAAA;AACnDH,QAAAA,cAAc,CAACG,MAAM,CAACC,IAAI,C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DebugIdSnippet,\n SentrySDKBuildFlags,\n} from \"@sentry/bundler-plugin-core\";\nimport type { Logger } from \"@sentry/bundler-plugin-core\";\nimport type { UnpluginOptions } from \"unplugin\";\nimport * as path from \"path\";\n\nimport { v4 as uuidv4 } from \"uuid\";\n\nfunction esbuildReleaseInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-release-injection-plugin\";\n const virtualReleaseInjectionFilePath = path.resolve(\"_sentry-release-injection-stub\"); // needs to be an absolute path for older eslint versions\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n initialOptions.inject = initialOptions.inject || [];\n initialOptions.inject.push(virtualReleaseInjectionFilePath);\n\n onResolve({ filter: /_sentry-release-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n };\n });\n\n onLoad({ filter: /_sentry-release-injection-stub/ }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n });\n },\n },\n };\n}\n\nfunction esbuildDebugIdInjectionPlugin(logger: Logger): UnpluginOptions {\n const pluginName = \"sentry-esbuild-debug-id-injection-plugin\";\n const stubNamespace = \"sentry-debug-id-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n if (!initialOptions.bundle) {\n logger.warn(\n \"The Sentry esbuild plugin only supports esbuild with `bundle: true` being set in the esbuild build options. Esbuild will probably crash now. Sorry about that. If you need to upload sourcemaps without `bundle: true`, it is recommended to use Sentry CLI instead: https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/\"\n );\n }\n\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-debug-id-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-debug-id-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad({ filter: /_sentry-debug-id-injection-stub/, namespace: stubNamespace }, () => {\n return {\n loader: \"js\",\n pluginName,\n contents: getDebugIdSnippet(uuidv4()),\n };\n });\n },\n },\n };\n}\n\nfunction esbuildModuleMetadataInjectionPlugin(injectionCode: string): UnpluginOptions {\n const pluginName = \"sentry-esbuild-module-metadata-injection-plugin\";\n const stubNamespace = \"sentry-module-metadata-stub\";\n\n return {\n name: pluginName,\n\n esbuild: {\n setup({ initialOptions, onLoad, onResolve }) {\n onResolve({ filter: /.*/ }, (args) => {\n if (args.kind !== \"entry-point\") {\n return;\n } else {\n // Injected modules via the esbuild `inject` option do also have `kind == \"entry-point\"`.\n // We do not want to inject debug IDs into those files because they are already bundled into the entrypoints\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),\n pluginData: {\n isMetadataProxyResolver: true,\n originalPath: args.path,\n originalResolveDir: args.resolveDir,\n },\n // We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse\n // the module tree any further down past the proxy module because we're essentially creating a dependency\n // loop back to the proxy module.\n // By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,\n // making it re-resolve the entrypoint when it is imported from the proxy module.\n // Super confusing? Yes. Works? Apparently... Let's see.\n suffix: \"?sentryMetadataProxyModule=true\",\n };\n }\n });\n\n onLoad({ filter: /.*/ }, (args) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(args.pluginData?.isMetadataProxyResolver as undefined | boolean)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalPath = args.pluginData.originalPath as string;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const originalResolveDir = args.pluginData.originalResolveDir as string;\n\n return {\n loader: \"js\",\n pluginName,\n // We need to use JSON.stringify below so that any escape backslashes stay escape backslashes, in order not to break paths on windows\n contents: `\n import \"_sentry-module-metadata-injection-stub\";\n import * as OriginalModule from ${JSON.stringify(originalPath)};\n export default OriginalModule.default;\n export * from ${JSON.stringify(originalPath)};`,\n resolveDir: originalResolveDir,\n };\n });\n\n onResolve({ filter: /_sentry-module-metadata-injection-stub/ }, (args) => {\n return {\n path: args.path,\n sideEffects: true,\n pluginName,\n namespace: stubNamespace,\n suffix: \"?sentry-module-id=\" + uuidv4(), // create different module, each time this is resolved\n };\n });\n\n onLoad(\n { filter: /_sentry-module-metadata-injection-stub/, namespace: stubNamespace },\n () => {\n return {\n loader: \"js\",\n pluginName,\n contents: injectionCode,\n };\n }\n );\n },\n },\n };\n}\n\nfunction esbuildDebugIdUploadPlugin(\n upload: (buildArtifacts: string[]) => Promise<void>\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-debug-id-upload-plugin\",\n esbuild: {\n setup({ initialOptions, onEnd }) {\n initialOptions.metafile = true;\n onEnd(async (result) => {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n });\n },\n },\n };\n}\n\nfunction esbuildBundleSizeOptimizationsPlugin(\n replacementValues: SentrySDKBuildFlags\n): UnpluginOptions {\n return {\n name: \"sentry-esbuild-bundle-size-optimizations-plugin\",\n esbuild: {\n setup({ initialOptions }) {\n const replacementStringValues: Record<string, string> = {};\n Object.entries(replacementValues).forEach(([key, value]) => {\n replacementStringValues[key] = JSON.stringify(value);\n });\n\n initialOptions.define = { ...initialOptions.define, ...replacementStringValues };\n },\n },\n };\n}\n\nconst sentryUnplugin = sentryUnpluginFactory({\n releaseInjectionPlugin: esbuildReleaseInjectionPlugin,\n debugIdInjectionPlugin: esbuildDebugIdInjectionPlugin,\n moduleMetadataInjectionPlugin: esbuildModuleMetadataInjectionPlugin,\n debugIdUploadPlugin: esbuildDebugIdUploadPlugin,\n bundleSizeOptimizationsPlugin: esbuildBundleSizeOptimizationsPlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryEsbuildPlugin: (options?: Options) => any = sentryUnplugin.esbuild;\n\nexport type { Options as SentryEsbuildPluginOptions } from \"@sentry/bundler-plugin-core\";\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n"],"names":["esbuildReleaseInjectionPlugin","injectionCode","pluginName","virtualReleaseInjectionFilePath","path","resolve","name","esbuild","setup","_ref","initialOptions","onLoad","onResolve","inject","push","filter","args","sideEffects","loader","contents","esbuildDebugIdInjectionPlugin","logger","stubNamespace","_ref2","bundle","warn","kind","_initialOptions$injec","includes","isAbsolute","join","resolveDir","pluginData","isProxyResolver","originalPath","originalResolveDir","suffix","_args$pluginData","concat","JSON","stringify","namespace","uuidv4","getDebugIdSnippet","esbuildModuleMetadataInjectionPlugin","_ref3","_initialOptions$injec2","isMetadataProxyResolver","_args$pluginData2","esbuildDebugIdUploadPlugin","upload","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","buildArtifacts","wrap","_callee$","_context","prev","next","Object","keys","outputs","stop","_x","apply","arguments","esbuildBundleSizeOptimizationsPlugin","replacementValues","_ref6","replacementStringValues","entries","forEach","_ref7","_ref8","_slicedToArray","key","value","define","_objectSpread","sentryUnplugin","sentryUnpluginFactory","releaseInjectionPlugin","debugIdInjectionPlugin","moduleMetadataInjectionPlugin","debugIdUploadPlugin","bundleSizeOptimizationsPlugin","sentryEsbuildPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,6BAA6BA,CAACC,aAAqB,EAAmB;EAC7E,IAAMC,UAAU,GAAG,yCAAyC,CAAA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AAC,CAAA;AAEFzE,QAAAA,cAAc,CAAC0E,MAAM,GAAAC,cAAA,CAAAA,cAAA,CAAQ3E,EAAAA,EAAAA,cAAc,CAAC0E,MAAM,CAAKR,EAAAA,uBAAuB,CAAE,CAAA;AAClF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMU,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAExF,6BAA6B;AACrDyF,EAAAA,sBAAsB,EAAErE,6BAA6B;AACrDsE,EAAAA,6BAA6B,EAAE9C,oCAAoC;AACnE+C,EAAAA,mBAAmB,EAAE1C,0BAA0B;AAC/C2C,EAAAA,6BAA6B,EAAEnB,oCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaoB,IAAAA,mBAA+C,GAAGP,cAAc,CAAC/E;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/esbuild-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "Official Sentry esbuild 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/esbuild-plugin",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"prepack": "ts-node ./src/prepack.ts"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sentry/bundler-plugin-core": "2.
|
|
51
|
+
"@sentry/bundler-plugin-core": "2.18.0",
|
|
52
52
|
"unplugin": "1.0.1",
|
|
53
53
|
"uuid": "^9.0.0"
|
|
54
54
|
},
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@babel/preset-typescript": "7.17.12",
|
|
59
59
|
"@rollup/plugin-babel": "5.3.1",
|
|
60
60
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
61
|
-
"@sentry-internal/eslint-config": "2.
|
|
62
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.
|
|
61
|
+
"@sentry-internal/eslint-config": "2.18.0",
|
|
62
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "2.18.0",
|
|
63
63
|
"@swc/core": "^1.2.205",
|
|
64
64
|
"@swc/jest": "^0.2.21",
|
|
65
65
|
"@types/jest": "^28.1.3",
|