@sentry/esbuild-plugin 4.6.1 → 4.6.2
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 +67 -26
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +67 -26
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -491,6 +491,18 @@ function esbuildReleaseInjectionPlugin(injectionCode) {
|
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Shared set to track entry points that have been wrapped by the metadata plugin
|
|
497
|
+
* This allows the debug ID plugin to know when an import is coming from a metadata proxy
|
|
498
|
+
*/
|
|
499
|
+
var metadataProxyEntryPoints = new Set();
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Set to track which paths have already been wrapped with debug ID injection
|
|
503
|
+
* This prevents the debug ID plugin from wrapping the same module multiple times
|
|
504
|
+
*/
|
|
505
|
+
var debugIdWrappedPaths = new Set();
|
|
494
506
|
function esbuildDebugIdInjectionPlugin(logger) {
|
|
495
507
|
var pluginName = "sentry-esbuild-debug-id-injection-plugin";
|
|
496
508
|
var stubNamespace = "sentry-debug-id-stub";
|
|
@@ -501,39 +513,61 @@ function esbuildDebugIdInjectionPlugin(logger) {
|
|
|
501
513
|
var initialOptions = _ref2.initialOptions,
|
|
502
514
|
onLoad = _ref2.onLoad,
|
|
503
515
|
onResolve = _ref2.onResolve;
|
|
516
|
+
// Clear state from previous builds (important for watch mode and test suites)
|
|
517
|
+
debugIdWrappedPaths.clear();
|
|
518
|
+
// Also clear metadataProxyEntryPoints here because if moduleMetadataInjectionPlugin
|
|
519
|
+
// is not instantiated in this build (e.g., moduleMetadata was disabled), we don't
|
|
520
|
+
// want stale entries from a previous build to affect the current one.
|
|
521
|
+
metadataProxyEntryPoints.clear();
|
|
504
522
|
if (!initialOptions.bundle) {
|
|
505
523
|
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
524
|
}
|
|
507
525
|
onResolve({
|
|
508
526
|
filter: /.*/
|
|
509
527
|
}, function (args) {
|
|
510
|
-
|
|
528
|
+
var _args$importer, _initialOptions$injec;
|
|
529
|
+
// Inject debug IDs into entry points and into imports from metadata proxy modules
|
|
530
|
+
var isEntryPoint = args.kind === "entry-point";
|
|
531
|
+
|
|
532
|
+
// Check if this import is coming from a metadata proxy module
|
|
533
|
+
// The metadata plugin registers entry points it wraps in the shared Set
|
|
534
|
+
// We need to strip the query string suffix because esbuild includes the suffix
|
|
535
|
+
// (e.g., ?sentryMetadataProxyModule=true) in args.importer
|
|
536
|
+
var importerPath = (_args$importer = args.importer) === null || _args$importer === void 0 ? void 0 : _args$importer.split("?")[0];
|
|
537
|
+
var isImportFromMetadataProxy = args.kind === "import-statement" && importerPath !== undefined && metadataProxyEntryPoints.has(importerPath);
|
|
538
|
+
if (!isEntryPoint && !isImportFromMetadataProxy) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Skip injecting debug IDs into modules specified in the esbuild `inject` option
|
|
543
|
+
// since they're already part of the entry points
|
|
544
|
+
if ((_initialOptions$injec = initialOptions.inject) !== null && _initialOptions$injec !== void 0 && _initialOptions$injec.includes(args.path)) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
var resolvedPath = path__namespace.isAbsolute(args.path) ? args.path : path__namespace.join(args.resolveDir, args.path);
|
|
548
|
+
|
|
549
|
+
// Skip injecting debug IDs into paths that have already been wrapped
|
|
550
|
+
if (debugIdWrappedPaths.has(resolvedPath)) {
|
|
511
551
|
return;
|
|
512
|
-
} else {
|
|
513
|
-
var _initialOptions$injec;
|
|
514
|
-
// Injected modules via the esbuild `inject` option do also have `kind == "entry-point"`.
|
|
515
|
-
// We do not want to inject debug IDs into those files because they are already bundled into the entrypoints
|
|
516
|
-
if ((_initialOptions$injec = initialOptions.inject) !== null && _initialOptions$injec !== void 0 && _initialOptions$injec.includes(args.path)) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
return {
|
|
520
|
-
pluginName: pluginName,
|
|
521
|
-
// needs to be an abs path, otherwise esbuild will complain
|
|
522
|
-
path: path__namespace.isAbsolute(args.path) ? args.path : path__namespace.join(args.resolveDir, args.path),
|
|
523
|
-
pluginData: {
|
|
524
|
-
isProxyResolver: true,
|
|
525
|
-
originalPath: args.path,
|
|
526
|
-
originalResolveDir: args.resolveDir
|
|
527
|
-
},
|
|
528
|
-
// We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse
|
|
529
|
-
// the module tree any further down past the proxy module because we're essentially creating a dependency
|
|
530
|
-
// loop back to the proxy module.
|
|
531
|
-
// By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,
|
|
532
|
-
// making it re-resolve the entrypoint when it is imported from the proxy module.
|
|
533
|
-
// Super confusing? Yes. Works? Apparently... Let's see.
|
|
534
|
-
suffix: "?sentryProxyModule=true"
|
|
535
|
-
};
|
|
536
552
|
}
|
|
553
|
+
debugIdWrappedPaths.add(resolvedPath);
|
|
554
|
+
return {
|
|
555
|
+
pluginName: pluginName,
|
|
556
|
+
// needs to be an abs path, otherwise esbuild will complain
|
|
557
|
+
path: resolvedPath,
|
|
558
|
+
pluginData: {
|
|
559
|
+
isProxyResolver: true,
|
|
560
|
+
originalPath: args.path,
|
|
561
|
+
originalResolveDir: args.resolveDir
|
|
562
|
+
},
|
|
563
|
+
// We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse
|
|
564
|
+
// the module tree any further down past the proxy module because we're essentially creating a dependency
|
|
565
|
+
// loop back to the proxy module.
|
|
566
|
+
// By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,
|
|
567
|
+
// making it re-resolve the entrypoint when it is imported from the proxy module.
|
|
568
|
+
// Super confusing? Yes. Works? Apparently... Let's see.
|
|
569
|
+
suffix: "?sentryProxyModule=true"
|
|
570
|
+
};
|
|
537
571
|
});
|
|
538
572
|
onLoad({
|
|
539
573
|
filter: /.*/
|
|
@@ -592,6 +626,8 @@ function esbuildModuleMetadataInjectionPlugin(injectionCode) {
|
|
|
592
626
|
var initialOptions = _ref3.initialOptions,
|
|
593
627
|
onLoad = _ref3.onLoad,
|
|
594
628
|
onResolve = _ref3.onResolve;
|
|
629
|
+
// Clear state from previous builds (important for watch mode and test suites)
|
|
630
|
+
metadataProxyEntryPoints.clear();
|
|
595
631
|
onResolve({
|
|
596
632
|
filter: /.*/
|
|
597
633
|
}, function (args) {
|
|
@@ -604,10 +640,15 @@ function esbuildModuleMetadataInjectionPlugin(injectionCode) {
|
|
|
604
640
|
if ((_initialOptions$injec2 = initialOptions.inject) !== null && _initialOptions$injec2 !== void 0 && _initialOptions$injec2.includes(args.path)) {
|
|
605
641
|
return;
|
|
606
642
|
}
|
|
643
|
+
var resolvedPath = path__namespace.isAbsolute(args.path) ? args.path : path__namespace.join(args.resolveDir, args.path);
|
|
644
|
+
|
|
645
|
+
// Register this entry point so the debug ID plugin knows to wrap imports from
|
|
646
|
+
// this proxy module, this because the debug ID may run after the metadata plugin
|
|
647
|
+
metadataProxyEntryPoints.add(resolvedPath);
|
|
607
648
|
return {
|
|
608
649
|
pluginName: pluginName,
|
|
609
650
|
// needs to be an abs path, otherwise esbuild will complain
|
|
610
|
-
path:
|
|
651
|
+
path: resolvedPath,
|
|
611
652
|
pluginData: {
|
|
612
653
|
isMetadataProxyResolver: true,
|
|
613
654
|
originalPath: args.path,
|
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 { 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 _logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void\n): UnpluginOptions {\n const freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();\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 try {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n } finally {\n freeGlobalDependencyOnDebugIdSourcemapArtifacts();\n }\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default sentryUnplugin.esbuild as (options?: Options) => any;\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","_logger","createDependencyOnBuildArtifacts","freeGlobalDependencyOnDebugIdSourcemapArtifacts","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","_buildArtifacts","wrap","_callee$","_context","prev","next","buildArtifacts","Object","keys","outputs","finish","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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Ac,CAACpF,OAAO;;;;;;;;;"}
|
|
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\n/**\n * Shared set to track entry points that have been wrapped by the metadata plugin\n * This allows the debug ID plugin to know when an import is coming from a metadata proxy\n */\nconst metadataProxyEntryPoints = new Set<string>();\n\n/**\n * Set to track which paths have already been wrapped with debug ID injection\n * This prevents the debug ID plugin from wrapping the same module multiple times\n */\nconst debugIdWrappedPaths = new Set<string>();\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 // Clear state from previous builds (important for watch mode and test suites)\n debugIdWrappedPaths.clear();\n // Also clear metadataProxyEntryPoints here because if moduleMetadataInjectionPlugin\n // is not instantiated in this build (e.g., moduleMetadata was disabled), we don't\n // want stale entries from a previous build to affect the current one.\n metadataProxyEntryPoints.clear();\n\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 // Inject debug IDs into entry points and into imports from metadata proxy modules\n const isEntryPoint = args.kind === \"entry-point\";\n\n // Check if this import is coming from a metadata proxy module\n // The metadata plugin registers entry points it wraps in the shared Set\n // We need to strip the query string suffix because esbuild includes the suffix\n // (e.g., ?sentryMetadataProxyModule=true) in args.importer\n const importerPath = args.importer?.split(\"?\")[0];\n const isImportFromMetadataProxy =\n args.kind === \"import-statement\" &&\n importerPath !== undefined &&\n metadataProxyEntryPoints.has(importerPath);\n\n if (!isEntryPoint && !isImportFromMetadataProxy) {\n return;\n }\n\n // Skip injecting debug IDs into modules specified in the esbuild `inject` option\n // since they're already part of the entry points\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n const resolvedPath = path.isAbsolute(args.path)\n ? args.path\n : path.join(args.resolveDir, args.path);\n\n // Skip injecting debug IDs into paths that have already been wrapped\n if (debugIdWrappedPaths.has(resolvedPath)) {\n return;\n }\n debugIdWrappedPaths.add(resolvedPath);\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: resolvedPath,\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 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 // Clear state from previous builds (important for watch mode and test suites)\n metadataProxyEntryPoints.clear();\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 const resolvedPath = path.isAbsolute(args.path)\n ? args.path\n : path.join(args.resolveDir, args.path);\n\n // Register this entry point so the debug ID plugin knows to wrap imports from\n // this proxy module, this because the debug ID may run after the metadata plugin\n metadataProxyEntryPoints.add(resolvedPath);\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: resolvedPath,\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 _logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void\n): UnpluginOptions {\n const freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();\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 try {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n } finally {\n freeGlobalDependencyOnDebugIdSourcemapArtifacts();\n }\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default sentryUnplugin.esbuild as (options?: Options) => any;\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","metadataProxyEntryPoints","Set","debugIdWrappedPaths","esbuildDebugIdInjectionPlugin","logger","stubNamespace","_ref2","clear","bundle","warn","_args$importer","_initialOptions$injec","isEntryPoint","kind","importerPath","importer","split","isImportFromMetadataProxy","undefined","has","includes","resolvedPath","isAbsolute","join","resolveDir","add","pluginData","isProxyResolver","originalPath","originalResolveDir","suffix","_args$pluginData","concat","JSON","stringify","namespace","uuidv4","getDebugIdSnippet","esbuildModuleMetadataInjectionPlugin","_ref3","_initialOptions$injec2","isMetadataProxyResolver","_args$pluginData2","esbuildDebugIdUploadPlugin","upload","_logger","createDependencyOnBuildArtifacts","freeGlobalDependencyOnDebugIdSourcemapArtifacts","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","_buildArtifacts","wrap","_callee$","_context","prev","next","buildArtifacts","Object","keys","outputs","finish","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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469
469
|
};
|
|
470
470
|
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Shared set to track entry points that have been wrapped by the metadata plugin
|
|
474
|
+
* This allows the debug ID plugin to know when an import is coming from a metadata proxy
|
|
475
|
+
*/
|
|
476
|
+
var metadataProxyEntryPoints = new Set();
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Set to track which paths have already been wrapped with debug ID injection
|
|
480
|
+
* This prevents the debug ID plugin from wrapping the same module multiple times
|
|
481
|
+
*/
|
|
482
|
+
var debugIdWrappedPaths = new Set();
|
|
471
483
|
function esbuildDebugIdInjectionPlugin(logger) {
|
|
472
484
|
var pluginName = "sentry-esbuild-debug-id-injection-plugin";
|
|
473
485
|
var stubNamespace = "sentry-debug-id-stub";
|
|
@@ -478,39 +490,61 @@ function esbuildDebugIdInjectionPlugin(logger) {
|
|
|
478
490
|
var initialOptions = _ref2.initialOptions,
|
|
479
491
|
onLoad = _ref2.onLoad,
|
|
480
492
|
onResolve = _ref2.onResolve;
|
|
493
|
+
// Clear state from previous builds (important for watch mode and test suites)
|
|
494
|
+
debugIdWrappedPaths.clear();
|
|
495
|
+
// Also clear metadataProxyEntryPoints here because if moduleMetadataInjectionPlugin
|
|
496
|
+
// is not instantiated in this build (e.g., moduleMetadata was disabled), we don't
|
|
497
|
+
// want stale entries from a previous build to affect the current one.
|
|
498
|
+
metadataProxyEntryPoints.clear();
|
|
481
499
|
if (!initialOptions.bundle) {
|
|
482
500
|
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
501
|
}
|
|
484
502
|
onResolve({
|
|
485
503
|
filter: /.*/
|
|
486
504
|
}, function (args) {
|
|
487
|
-
|
|
505
|
+
var _args$importer, _initialOptions$injec;
|
|
506
|
+
// Inject debug IDs into entry points and into imports from metadata proxy modules
|
|
507
|
+
var isEntryPoint = args.kind === "entry-point";
|
|
508
|
+
|
|
509
|
+
// Check if this import is coming from a metadata proxy module
|
|
510
|
+
// The metadata plugin registers entry points it wraps in the shared Set
|
|
511
|
+
// We need to strip the query string suffix because esbuild includes the suffix
|
|
512
|
+
// (e.g., ?sentryMetadataProxyModule=true) in args.importer
|
|
513
|
+
var importerPath = (_args$importer = args.importer) === null || _args$importer === void 0 ? void 0 : _args$importer.split("?")[0];
|
|
514
|
+
var isImportFromMetadataProxy = args.kind === "import-statement" && importerPath !== undefined && metadataProxyEntryPoints.has(importerPath);
|
|
515
|
+
if (!isEntryPoint && !isImportFromMetadataProxy) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// Skip injecting debug IDs into modules specified in the esbuild `inject` option
|
|
520
|
+
// since they're already part of the entry points
|
|
521
|
+
if ((_initialOptions$injec = initialOptions.inject) !== null && _initialOptions$injec !== void 0 && _initialOptions$injec.includes(args.path)) {
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
var resolvedPath = path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path);
|
|
525
|
+
|
|
526
|
+
// Skip injecting debug IDs into paths that have already been wrapped
|
|
527
|
+
if (debugIdWrappedPaths.has(resolvedPath)) {
|
|
488
528
|
return;
|
|
489
|
-
} else {
|
|
490
|
-
var _initialOptions$injec;
|
|
491
|
-
// Injected modules via the esbuild `inject` option do also have `kind == "entry-point"`.
|
|
492
|
-
// We do not want to inject debug IDs into those files because they are already bundled into the entrypoints
|
|
493
|
-
if ((_initialOptions$injec = initialOptions.inject) !== null && _initialOptions$injec !== void 0 && _initialOptions$injec.includes(args.path)) {
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
return {
|
|
497
|
-
pluginName: pluginName,
|
|
498
|
-
// needs to be an abs path, otherwise esbuild will complain
|
|
499
|
-
path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),
|
|
500
|
-
pluginData: {
|
|
501
|
-
isProxyResolver: true,
|
|
502
|
-
originalPath: args.path,
|
|
503
|
-
originalResolveDir: args.resolveDir
|
|
504
|
-
},
|
|
505
|
-
// We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse
|
|
506
|
-
// the module tree any further down past the proxy module because we're essentially creating a dependency
|
|
507
|
-
// loop back to the proxy module.
|
|
508
|
-
// By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,
|
|
509
|
-
// making it re-resolve the entrypoint when it is imported from the proxy module.
|
|
510
|
-
// Super confusing? Yes. Works? Apparently... Let's see.
|
|
511
|
-
suffix: "?sentryProxyModule=true"
|
|
512
|
-
};
|
|
513
529
|
}
|
|
530
|
+
debugIdWrappedPaths.add(resolvedPath);
|
|
531
|
+
return {
|
|
532
|
+
pluginName: pluginName,
|
|
533
|
+
// needs to be an abs path, otherwise esbuild will complain
|
|
534
|
+
path: resolvedPath,
|
|
535
|
+
pluginData: {
|
|
536
|
+
isProxyResolver: true,
|
|
537
|
+
originalPath: args.path,
|
|
538
|
+
originalResolveDir: args.resolveDir
|
|
539
|
+
},
|
|
540
|
+
// We need to add a suffix here, otherwise esbuild will mark the entrypoint as resolved and won't traverse
|
|
541
|
+
// the module tree any further down past the proxy module because we're essentially creating a dependency
|
|
542
|
+
// loop back to the proxy module.
|
|
543
|
+
// By setting a suffix we're telling esbuild that the entrypoint and proxy module are two different things,
|
|
544
|
+
// making it re-resolve the entrypoint when it is imported from the proxy module.
|
|
545
|
+
// Super confusing? Yes. Works? Apparently... Let's see.
|
|
546
|
+
suffix: "?sentryProxyModule=true"
|
|
547
|
+
};
|
|
514
548
|
});
|
|
515
549
|
onLoad({
|
|
516
550
|
filter: /.*/
|
|
@@ -569,6 +603,8 @@ function esbuildModuleMetadataInjectionPlugin(injectionCode) {
|
|
|
569
603
|
var initialOptions = _ref3.initialOptions,
|
|
570
604
|
onLoad = _ref3.onLoad,
|
|
571
605
|
onResolve = _ref3.onResolve;
|
|
606
|
+
// Clear state from previous builds (important for watch mode and test suites)
|
|
607
|
+
metadataProxyEntryPoints.clear();
|
|
572
608
|
onResolve({
|
|
573
609
|
filter: /.*/
|
|
574
610
|
}, function (args) {
|
|
@@ -581,10 +617,15 @@ function esbuildModuleMetadataInjectionPlugin(injectionCode) {
|
|
|
581
617
|
if ((_initialOptions$injec2 = initialOptions.inject) !== null && _initialOptions$injec2 !== void 0 && _initialOptions$injec2.includes(args.path)) {
|
|
582
618
|
return;
|
|
583
619
|
}
|
|
620
|
+
var resolvedPath = path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path);
|
|
621
|
+
|
|
622
|
+
// Register this entry point so the debug ID plugin knows to wrap imports from
|
|
623
|
+
// this proxy module, this because the debug ID may run after the metadata plugin
|
|
624
|
+
metadataProxyEntryPoints.add(resolvedPath);
|
|
584
625
|
return {
|
|
585
626
|
pluginName: pluginName,
|
|
586
627
|
// needs to be an abs path, otherwise esbuild will complain
|
|
587
|
-
path:
|
|
628
|
+
path: resolvedPath,
|
|
588
629
|
pluginData: {
|
|
589
630
|
isMetadataProxyResolver: true,
|
|
590
631
|
originalPath: args.path,
|
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 { 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 _logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void\n): UnpluginOptions {\n const freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();\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 try {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n } finally {\n freeGlobalDependencyOnDebugIdSourcemapArtifacts();\n }\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default sentryUnplugin.esbuild as (options?: Options) => any;\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","_logger","createDependencyOnBuildArtifacts","freeGlobalDependencyOnDebugIdSourcemapArtifacts","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","_buildArtifacts","wrap","_callee$","_context","prev","next","buildArtifacts","Object","keys","outputs","finish","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,IAAI,CAACC,OAAO,CAAC,gCAAgC,CAAC,CAAC;;EA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AAC,UAAAC,KAAA,EAAkB;AAAA,UAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA,EAAA,CAAA,CAAA;AAAhBG,YAAAA,GAAG,GAAAF,KAAA,CAAA,CAAA,CAAA;AAAEG,YAAAA,KAAK,GAAAH,KAAA,CAAA,CAAA,CAAA,CAAA;UACpDJ,uBAAuB,CAACM,GAAG,CAAC,GAAGhD,IAAI,CAACC,SAAS,CAACgD,KAAK,CAAC,CAAA;AACtD,SAAC,CAAC,CAAA;AAEF9E,QAAAA,cAAc,CAAC+E,MAAM,GAAAC,cAAA,CAAAA,cAAA,CAAQhF,EAAAA,EAAAA,cAAc,CAAC+E,MAAM,CAAKR,EAAAA,uBAAuB,CAAE,CAAA;AAClF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMU,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAE7F,6BAA6B;AACrD8F,EAAAA,sBAAsB,EAAE1E,6BAA6B;AACrD2E,EAAAA,6BAA6B,EAAEnD,oCAAoC;AACnEoD,EAAAA,mBAAmB,EAAE/C,0BAA0B;AAC/CgD,EAAAA,6BAA6B,EAAEnB,oCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaoB,IAAAA,mBAA+C,GAAGP,cAAc,CAACpF,QAAO;;AAErF;AACA,YAAeoF,cAAc,CAACpF,OAAO;;;;"}
|
|
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 { 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\n/**\n * Shared set to track entry points that have been wrapped by the metadata plugin\n * This allows the debug ID plugin to know when an import is coming from a metadata proxy\n */\nconst metadataProxyEntryPoints = new Set<string>();\n\n/**\n * Set to track which paths have already been wrapped with debug ID injection\n * This prevents the debug ID plugin from wrapping the same module multiple times\n */\nconst debugIdWrappedPaths = new Set<string>();\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 // Clear state from previous builds (important for watch mode and test suites)\n debugIdWrappedPaths.clear();\n // Also clear metadataProxyEntryPoints here because if moduleMetadataInjectionPlugin\n // is not instantiated in this build (e.g., moduleMetadata was disabled), we don't\n // want stale entries from a previous build to affect the current one.\n metadataProxyEntryPoints.clear();\n\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 // Inject debug IDs into entry points and into imports from metadata proxy modules\n const isEntryPoint = args.kind === \"entry-point\";\n\n // Check if this import is coming from a metadata proxy module\n // The metadata plugin registers entry points it wraps in the shared Set\n // We need to strip the query string suffix because esbuild includes the suffix\n // (e.g., ?sentryMetadataProxyModule=true) in args.importer\n const importerPath = args.importer?.split(\"?\")[0];\n const isImportFromMetadataProxy =\n args.kind === \"import-statement\" &&\n importerPath !== undefined &&\n metadataProxyEntryPoints.has(importerPath);\n\n if (!isEntryPoint && !isImportFromMetadataProxy) {\n return;\n }\n\n // Skip injecting debug IDs into modules specified in the esbuild `inject` option\n // since they're already part of the entry points\n if (initialOptions.inject?.includes(args.path)) {\n return;\n }\n\n const resolvedPath = path.isAbsolute(args.path)\n ? args.path\n : path.join(args.resolveDir, args.path);\n\n // Skip injecting debug IDs into paths that have already been wrapped\n if (debugIdWrappedPaths.has(resolvedPath)) {\n return;\n }\n debugIdWrappedPaths.add(resolvedPath);\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: resolvedPath,\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 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 // Clear state from previous builds (important for watch mode and test suites)\n metadataProxyEntryPoints.clear();\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 const resolvedPath = path.isAbsolute(args.path)\n ? args.path\n : path.join(args.resolveDir, args.path);\n\n // Register this entry point so the debug ID plugin knows to wrap imports from\n // this proxy module, this because the debug ID may run after the metadata plugin\n metadataProxyEntryPoints.add(resolvedPath);\n\n return {\n pluginName,\n // needs to be an abs path, otherwise esbuild will complain\n path: resolvedPath,\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 _logger: Logger,\n createDependencyOnBuildArtifacts: () => () => void\n): UnpluginOptions {\n const freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();\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 try {\n const buildArtifacts = result.metafile ? Object.keys(result.metafile.outputs) : [];\n await upload(buildArtifacts);\n } finally {\n freeGlobalDependencyOnDebugIdSourcemapArtifacts();\n }\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default sentryUnplugin.esbuild as (options?: Options) => any;\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","metadataProxyEntryPoints","Set","debugIdWrappedPaths","esbuildDebugIdInjectionPlugin","logger","stubNamespace","_ref2","clear","bundle","warn","_args$importer","_initialOptions$injec","isEntryPoint","kind","importerPath","importer","split","isImportFromMetadataProxy","undefined","has","includes","resolvedPath","isAbsolute","join","resolveDir","add","pluginData","isProxyResolver","originalPath","originalResolveDir","suffix","_args$pluginData","concat","JSON","stringify","namespace","uuidv4","getDebugIdSnippet","esbuildModuleMetadataInjectionPlugin","_ref3","_initialOptions$injec2","isMetadataProxyResolver","_args$pluginData2","esbuildDebugIdUploadPlugin","upload","_logger","createDependencyOnBuildArtifacts","freeGlobalDependencyOnDebugIdSourcemapArtifacts","_ref4","onEnd","metafile","_ref5","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","_buildArtifacts","wrap","_callee$","_context","prev","next","buildArtifacts","Object","keys","outputs","finish","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,IAAI,CAACC,OAAO,CAAC,gCAAgC,CAAC,CAAC;;EAEvF,OAAO;AACLC,IAAAA,IAAI,EAAEJ,UAAU;AAEhBK,IAAAA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,KAAK,GAAAH,KAAA,CAAA,CAAA,CAAA,CAAA;UACpDJ,uBAAuB,CAACM,GAAG,CAAC,GAAGhD,IAAI,CAACC,SAAS,CAACgD,KAAK,CAAC,CAAA;AACtD,SAAC,CAAC,CAAA;AAEF5F,QAAAA,cAAc,CAAC6F,MAAM,GAAAC,cAAA,CAAAA,cAAA,CAAQ9F,EAAAA,EAAAA,cAAc,CAAC6F,MAAM,CAAKR,EAAAA,uBAAuB,CAAE,CAAA;AAClF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAA;AAEA,IAAMU,cAAc,GAAGC,qBAAqB,CAAC;AAC3CC,EAAAA,sBAAsB,EAAE3G,6BAA6B;AACrD4G,EAAAA,sBAAsB,EAAErF,6BAA6B;AACrDsF,EAAAA,6BAA6B,EAAEnD,oCAAoC;AACnEoD,EAAAA,mBAAmB,EAAE/C,0BAA0B;AAC/CgD,EAAAA,6BAA6B,EAAEnB,oCAAAA;AACjC,CAAC,CAAC,CAAA;;AAEF;AACaoB,IAAAA,mBAA+C,GAAGP,cAAc,CAAClG,QAAO;;AAErF;AACA,YAAekG,cAAc,CAAClG,OAAO;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/esbuild-plugin",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.2",
|
|
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": "4.6.
|
|
51
|
+
"@sentry/bundler-plugin-core": "4.6.2",
|
|
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": "4.6.
|
|
62
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.6.
|
|
61
|
+
"@sentry-internal/eslint-config": "4.6.2",
|
|
62
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.6.2",
|
|
63
63
|
"@swc/core": "^1.2.205",
|
|
64
64
|
"@swc/jest": "^0.2.21",
|
|
65
65
|
"@types/jest": "^28.1.3",
|