Skip to content

Commit

Permalink
fix: filepath no startsWith '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
baozouai committed Jul 31, 2023
1 parent 672b030 commit ea17212
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -156,7 +156,7 @@ export default function enhanceLogPlugin(options: Options = {}): PluginOption {
let relativeFilename = ''

if (enableFileName) {
relativeFilename = id.replace(`${root}`, '').split('?')[0]
relativeFilename = id.replace(`${root}/`, '').split('?')[0]
if (typeof enableFileName === 'object' && !enableFileName.enableDir)
relativeFilename = relativeFilename.replace(/.*\//, '')
}
Expand Down

0 comments on commit ea17212

Please sign in to comment.