在 vitepress 内如何使用 @vuepress/markdown 的 importCodePlugin 插件? #1635
-
| 在 vitepress 内如何使用 @vuepress/markdown 的 importCodePlugin 插件?我非常喜欢 vuepress 的 请问我应该怎么在 vitepress 项目内使用 @vuepress/markdown 的 importCodePlugin 插件? 请问下面的配置方式对么? import { defineConfig, type DefaultTheme } from "vitepress";
import { importCodePlugin } from "@vuepress/markdown";
export default defineConfig({
	/**
	 * @see https://vitepress.dev/zh/guide/markdown#advanced-configuration
	 */
	markdown: {
		config: (md) => {
			md.use(importCodePlugin, { handleImportPath: (str) => join(process.cwd(), str) });
		},
	},
}); | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            Mister-Hope
          
      
      
        Feb 25, 2025 
      
    
    Replies: 1 comment
-
| 不确定,env的结构可能不同,我们不保证任何插件兼容vitepress系统也不会主动进行任何兼容。 我更建议你把相关代码提取出来自己维护。 | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        Mister-Hope
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
不确定,env的结构可能不同,我们不保证任何插件兼容vitepress系统也不会主动进行任何兼容。
我更建议你把相关代码提取出来自己维护。