import type { App } from 'vuepress' import type { Markdown } from 'vuepress/markdown' import type { DemoContainerRender, DemoFile, DemoMeta, MarkdownDemoEnv } from '../../shared/demo.js' import fs from 'node:fs' import path from 'node:path' import { stringifyAttrs } from '../utils/stringifyAttrs.js' import { compileScript, compileStyle } from './supports/compiler.js' import { findFile, readFileSync, writeFileSync } from './supports/file.js' import { insertSetupScript } from './supports/insertScript.js' import { addTask, checkDemoRender, markDemoRender } from './watcher.js' interface NormalCode { html?: string script?: string css?: string imports?: string jsType: 'ts' | 'js' cssType: 'css' | 'scss' | 'less' | 'stylus' } const CONFIG_RE = /