Skip to content

Commit

Permalink
fix: node 14 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Oct 4, 2022
1 parent 315ad37 commit e8b1a77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default createUnplugin<Options>((options = {}) => {
if (!src || !filter(src)) return

const [name, pattern] = id.replace(ID_PREFIX, '').split(':', 2)
return `${ID_PREFIX}${name}:${src.replaceAll(
':',
return `${ID_PREFIX}${name}:${src.replace(
/:/g,
(s) => `\\${s}`
)}:${pattern}`
},
Expand All @@ -36,7 +36,7 @@ export default createUnplugin<Options>((options = {}) => {
const [name, src, pattern] = id
.replace(ID_PREFIX, '')
.split(/(?<!\\):/, 3)
const filename = src.replaceAll('\\:', ':')
const filename = src.replace(/\\:/g, ':')

const files = (
await glob(pattern, {
Expand Down

0 comments on commit e8b1a77

Please sign in to comment.