@@ -126,11 +126,7 @@ function serverEnvironmentOnly(plugin: UnknownPlugin): UnknownPlugin {
126126 * Returns the cleaned module id when the module is eligible for injection,
127127 * `null` otherwise. Caller is responsible for recording the injection.
128128 */
129- function eligibleDevEntry (
130- injectedServeModules : Map < string , string > ,
131- id : string ,
132- environment : string ,
133- ) : string | null {
129+ function eligibleDevEntry ( injectedServeModules : Map < string , string > , id : string , environment : string ) : string | null {
134130 const cleanId = id . split ( '?' ) [ 0 ] ?? id ;
135131 const injectedModule = injectedServeModules . get ( environment ) ;
136132
@@ -171,9 +167,6 @@ const RESOLVED_REGISTER_MODULE_ID = `\0${REGISTER_MODULE_ID}`;
171167 * eligible source module transformed in each server environment.
172168 */
173169function registerIntegrationsPlugin ( ) : UnknownPlugin {
174- // `createRequire().resolve(REGISTER_MODULE)` would select the package's CJS
175- // export. Resolve the package root instead and explicitly target the ESM
176- // export which is bundled alongside the ESM-only Vite plugin.
177170 const require = createRequire ( import . meta. url ) ;
178171 const packageRoot = dirname ( require . resolve ( '@sentry/server-utils/package.json' ) ) ;
179172 const resolvedRegisterModule = resolve ( packageRoot , 'build/esm/orchestrion/index.js' ) ;
@@ -197,7 +190,7 @@ function registerIntegrationsPlugin(): UnknownPlugin {
197190 if ( code . includes ( REGISTER_MODULE_ID ) ) return null ;
198191
199192 const ms = new MagicString ( code ) ;
200- const injection = `import ${ JSON . stringify ( REGISTER_MODULE_ID ) } ;\n` ;
193+ const injection = `import ' ${ REGISTER_MODULE_ID } ' ;\n` ;
201194 ms . prepend ( injection ) ;
202195
203196 return { code : ms . toString ( ) , map : ms . generateMap ( { hires : true } ) } ;
@@ -218,7 +211,7 @@ function registerIntegrationsPlugin(): UnknownPlugin {
218211 // imports here and let Rollup tree-shake the rest of the ESM module.
219212 return {
220213 code : [
221- `import { registerChannelIntegrations } from ${ JSON . stringify ( resolvedRegisterModule ) } ;` ,
214+ `import { registerChannelIntegrations } from ' ${ resolvedRegisterModule } ' ;` ,
222215 'registerChannelIntegrations();' ,
223216 '' ,
224217 ] . join ( '\n' ) ,
@@ -251,11 +244,7 @@ function registerIntegrationsPlugin(): UnknownPlugin {
251244 } ;
252245}
253246
254- function bundlerMarkerPlugin ( {
255- hasRegistrationPlugin,
256- } : {
257- hasRegistrationPlugin : boolean ;
258- } ) : UnknownPlugin {
247+ function bundlerMarkerPlugin ( { hasRegistrationPlugin } : { hasRegistrationPlugin : boolean } ) : UnknownPlugin {
259248 const banner = [
260249 'globalThis.__SENTRY_ORCHESTRION__ = (globalThis.__SENTRY_ORCHESTRION__ || {});' ,
261250 'globalThis.__SENTRY_ORCHESTRION__.bundler = true;' ,
0 commit comments