File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { fileURLToPath } from 'url'
1
2
import { defu } from 'defu'
2
3
import { resolvePath } from 'mlly'
3
4
import type { SentryCliPluginOptions } from '@sentry/webpack-plugin'
@@ -13,6 +14,8 @@ export type { ModuleOptions, ModulePublicRuntimeConfig }
13
14
14
15
const logger = useLogger ( 'nuxt:sentry' )
15
16
17
+ const moduleDir = fileURLToPath ( new URL ( './' , import . meta. url ) )
18
+
16
19
export default defineNuxtModule < ModuleConfiguration > ( {
17
20
meta : {
18
21
name : '@nuxtjs/sentry' ,
@@ -94,9 +97,9 @@ export default defineNuxtModule<ModuleConfiguration>({
94
97
...( options . tracing ? [ '@sentry/tracing' ] : [ ] ) ,
95
98
]
96
99
for ( const dep of aliasedDependencies ) {
97
- nuxt . options . alias [ `~${ dep } ` ] = ( await resolvePath ( dep ) ) . replace ( / \/ c j s \/ / , '/esm/' )
100
+ nuxt . options . alias [ `~${ dep } ` ] = ( await resolvePath ( dep , { url : moduleDir } ) ) . replace ( / \/ c j s \/ / , '/esm/' )
98
101
}
99
- nuxt . options . alias [ '~@sentry/browser-sdk' ] = ( await resolvePath ( '@sentry/browser/esm/sdk' ) )
102
+ nuxt . options . alias [ '~@sentry/browser-sdk' ] = ( await resolvePath ( '@sentry/browser/esm/sdk' , { url : moduleDir } ) )
100
103
101
104
if ( serverSentryEnabled ( options ) ) {
102
105
/**
You can’t perform that action at this time.
0 commit comments