Skip to content

Commit

Permalink
docs: fix hydration mismatch (#5596)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Apr 23, 2024
1 parent 2b3fc0f commit e0ae829
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Learn more about [IDE Integrations](/guide/ide)

## Examples

[@@include](../../../examples/README.md)
<!--@include: ../../../examples/README.md-->

## Projects using Vitest

Expand Down
20 changes: 0 additions & 20 deletions docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import fs from 'node:fs'
import type { Plugin } from 'vite'
import { defineConfig } from 'vite'
import Components from 'unplugin-vue-components/vite'
import Unocss from 'unocss/vite'
import { presetAttributify, presetIcons, presetUno } from 'unocss'
import { resolve } from 'pathe'

export default defineConfig({
optimizeDeps: {
Expand Down Expand Up @@ -37,23 +35,5 @@ export default defineConfig({
}),
],
}),
IncludesPlugin(),
],
})

function IncludesPlugin(): Plugin {
return {
name: 'include-plugin',
enforce: 'pre',
transform(code, id) {
let changed = false
code = code.replace(/\[@@include\]\((.*?)\)/, (_, url) => {
changed = true
const full = resolve(id, url)
return fs.readFileSync(full, 'utf-8')
})
if (changed)
return code
},
}
}

0 comments on commit e0ae829

Please sign in to comment.