mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(vite): don't match across newlines (#4596)
This commit is contained in:
parent
8fae863997
commit
b8d2e64c78
@ -89,7 +89,7 @@ export const DynamicBasePlugin = createUnplugin(function (options: DynamicBasePl
|
||||
s.replace(/from *['"]\/__NUXT_BASE__(\/[^'"]*)['"]/g, 'from "$1"')
|
||||
|
||||
// Dynamically compute string URLs featuring baseURL
|
||||
const delimiterRE = /(?<!(const base = |from *))(`([^`]*)\/__NUXT_BASE__\/([^`]*)`|'([^']*)\/__NUXT_BASE__\/([^']*)'|"([^"]*)\/__NUXT_BASE__\/([^"]*)")/g
|
||||
const delimiterRE = /(?<!(const base = |from *))(`([^`]*)\/__NUXT_BASE__\/([^`]*)`|'([^\n']*)\/__NUXT_BASE__\/([^\n']*)'|"([^\n"]*)\/__NUXT_BASE__\/([^\n"]*)")/g
|
||||
/* eslint-disable-next-line no-template-curly-in-string */
|
||||
s.replace(delimiterRE, r => '`' + r.replace(/\/__NUXT_BASE__\//g, '${__publicAssetsURL()}').slice(1, -1) + '`')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user