mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): make dev-only regexp less greedy (#9679)
This commit is contained in:
parent
9cd3c16675
commit
4cf110e0d8
@ -9,7 +9,7 @@ interface DevOnlyPluginOptions {
|
||||
}
|
||||
|
||||
export const DevOnlyPlugin = createUnplugin((options: DevOnlyPluginOptions) => {
|
||||
const DEVONLY_COMP_RE = /<dev-?only>(:?[\s\S]*)<\/dev-?only>/gmi
|
||||
const DEVONLY_COMP_RE = /<(dev-only|DevOnly)>[\s\S]*?<\/(dev-only|DevOnly)>/g
|
||||
|
||||
return {
|
||||
name: 'nuxt:server-devonly:transform',
|
||||
|
2
test/fixtures/basic/pages/index.vue
vendored
2
test/fixtures/basic/pages/index.vue
vendored
@ -7,6 +7,8 @@
|
||||
<div>RuntimeConfig | testConfig: {{ config.testConfig }}</div>
|
||||
<div>Composable | foo: {{ foo }}</div>
|
||||
<div>Composable | bar: {{ bar }}</div>
|
||||
<DevOnly>Some dev-only info</DevOnly>
|
||||
<div><DevOnly>Some dev-only info</DevOnly></div>
|
||||
<div>Composable | template: {{ templateAutoImport }}</div>
|
||||
<div>Path: {{ $route.fullPath }}</div>
|
||||
<NuxtLink to="/">
|
||||
|
Loading…
Reference in New Issue
Block a user