Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 549c900

Browse files
authored
fix(plugin-dehydrate): find string in a right way (#53)
1 parent 3a24c05 commit 549c900

File tree

1 file changed

+3
-3
lines changed
  • packages/vuepress-plugin-dehydrate/src

1 file changed

+3
-3
lines changed

packages/vuepress-plugin-dehydrate/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ const DehydratePlugin: Plugin<DehydratePluginOptions> = (
7575
ready(): void {
7676
// hack into current ssr template
7777
let template = readFileSync(context.ssrTemplate, 'utf8')
78-
if (template.search(contentWrapper) < 0) {
78+
if (template.indexOf(contentWrapper) < 0) {
7979
template = template.replace(contentOriginal, contentWrapper)
8080
}
81-
if (template.search(resourceWrapper) < 0) {
81+
if (template.indexOf(resourceWrapper) < 0) {
8282
template = template.replace(resourceOriginal, resourceWrapper)
8383
}
84-
if (template.search(scriptsWrapper) < 0) {
84+
if (template.indexOf(scriptsWrapper) < 0) {
8585
template = template.replace(scriptsOriginal, scriptsWrapper)
8686
}
8787
writeFileSync(context.ssrTemplate, template)

0 commit comments

Comments
 (0)