mirror of https://github.com/vuejs/vitepress
parent
47bddf6ac6
commit
fac49e8dbb
@ -1 +1 @@
|
||||
export * from './server'
|
||||
export * from './server/server'
|
||||
|
@ -1,6 +1,9 @@
|
||||
import MarkdownIt from 'markdown-it'
|
||||
import { MarkdownParsedData } from '../markdown'
|
||||
|
||||
export const hoistPlugin = (md: MarkdownIt & { __data: any }) => {
|
||||
// hoist <script> and <style> tags out of the returned html
|
||||
// so that they can be placed outside as SFC blocks.
|
||||
export const hoistPlugin = (md: MarkdownIt & { __data: MarkdownParsedData }) => {
|
||||
const RE = /^<(script|style)(?=(\s|>|$))/i
|
||||
|
||||
md.renderer.rules.html_block = (tokens, idx) => {
|
@ -1,13 +1,13 @@
|
||||
import path from 'path'
|
||||
import { createServer as createViteServer, cachedRead, Plugin } from 'vite'
|
||||
import { createMarkdownFn } from './markdownToVue'
|
||||
import { createMarkdownToVueRenderFn } from '../markdown/markdownToVue'
|
||||
import { VitePressResolver, THEME_PATH, APP_PATH } from './resolver'
|
||||
|
||||
const debug = require('debug')('vitepress:serve')
|
||||
const debugHmr = require('debug')('vitepress:hmr')
|
||||
|
||||
const VitePressPlugin: Plugin = ({ app, root, watcher, resolver }) => {
|
||||
const markdownToVue = createMarkdownFn(root)
|
||||
const markdownToVue = createMarkdownToVueRenderFn(root)
|
||||
|
||||
// watch theme files if it's outside of project root
|
||||
if (path.relative(root, THEME_PATH).startsWith('..')) {
|
Loading…
Reference in new issue