Skip to content

Commit a9221ff

Browse files
committed
fix(utils): [fillModules] specifier replacement
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent ada4cfb commit a9221ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/fill-modules.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { SpecifierSyntaxKind } from '#src/enums'
77
import type { FillModuleOptions } from '#src/interfaces'
8+
import regexp from '#src/internal/escape-reg-exp'
89
import isFunction from '#src/internal/is-function'
910
import { ERR_UNKNOWN_FILE_EXTENSION } from '@flex-development/errnode'
1011
import pathe, { type Ext } from '@flex-development/pathe'
@@ -101,7 +102,7 @@ const fillModules = async (
101102
code = code.replace(
102103
statement.code,
103104
statement.code.replace(
104-
statement.specifier,
105+
new RegExp(`(?<=["'])${regexp(statement.specifier)}(?=["'])`),
105106
// convert module url back to absolute, bare, or relative specifier
106107
statement.specifier.startsWith('#')
107108
? statement.specifier

0 commit comments

Comments
 (0)