markstream-vue2-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Markstream Vue 2 CLI

Markstream Vue 2 CLI

Use this skill when the host app is Vue 2 on Vue CLI or another Webpack 4-style stack.
当宿主项目是基于Vue CLI或其他Webpack 4类技术栈的Vue 2项目时,可使用本技能。

Workflow

工作流程

  1. Confirm the repo uses Vue 2 plus Vue CLI or Webpack 4-era tooling.
  2. Install
    markstream-vue2
    and only the peers required for the requested features.
  3. Import
    markstream-vue2/dist/index.css
    in the app shell.
  4. Avoid Vite-style
    ?worker
    imports.
    • Use
      createKaTeXWorkerFromCDN(...)
      and
      createMermaidWorkerFromCDN(...)
      when workers are needed.
  5. Prefer stable code block defaults over brittle Monaco wiring.
    • MarkdownCodeBlockNode
      plus
      stream-markdown
      is safer than Monaco in Webpack 4-era repos.
  6. Validate with the smallest useful local dev or build command.
  1. 确认仓库使用Vue 2搭配Vue CLI或Webpack 4时代的工具链。
  2. 安装
    markstream-vue2
    以及仅所需功能对应的依赖包。
  3. 在项目入口文件中导入
    markstream-vue2/dist/index.css
  4. 避免使用Vite风格的
    ?worker
    导入方式。
    • 当需要Worker时,使用
      createKaTeXWorkerFromCDN(...)
      createMermaidWorkerFromCDN(...)
  5. 优先选择稳定的代码块默认设置,而非脆弱的Monaco配置。
    • 在Webpack 4时代的仓库中,
      MarkdownCodeBlockNode
      搭配
      stream-markdown
      比Monaco更安全。
  6. 通过最小化的本地开发或构建命令进行验证。

Default Decisions

默认决策

  • Treat Monaco and worker-heavy setups as opt-in and fragile on Webpack 4.
  • Prefer CDN workers over bundler workers for Mermaid and KaTeX.
  • Keep the Vue 2 composition-api shim explicit when the repo is on Vue 2.6.
  • 在Webpack 4环境下,将Monaco和依赖Worker较多的配置视为可选且易出问题的方案。
  • 对于Mermaid和KaTeX,优先选择CDN Worker而非打包工具内置的Worker。
  • 当仓库使用Vue 2.6时,明确保留Vue 2 composition-api垫片。

Useful Doc Targets

相关文档

  • docs/guide/vue2-quick-start.md
  • docs/guide/vue2-installation.md
  • docs/guide/troubleshooting.md
  • docs/guide/vue2-quick-start.md
  • docs/guide/vue2-installation.md
  • docs/guide/troubleshooting.md