mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +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) => {
|
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 {
|
return {
|
||||||
name: 'nuxt:server-devonly:transform',
|
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>RuntimeConfig | testConfig: {{ config.testConfig }}</div>
|
||||||
<div>Composable | foo: {{ foo }}</div>
|
<div>Composable | foo: {{ foo }}</div>
|
||||||
<div>Composable | bar: {{ bar }}</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>Composable | template: {{ templateAutoImport }}</div>
|
||||||
<div>Path: {{ $route.fullPath }}</div>
|
<div>Path: {{ $route.fullPath }}</div>
|
||||||
<NuxtLink to="/">
|
<NuxtLink to="/">
|
||||||
|
Loading…
Reference in New Issue
Block a user