跳到正文
Skillpedia
网站与界面(前端)48k · #5175

markstream-vue2-cli

它能做什么

这个工具可以帮你在使用 Vue CLI 或 Webpack 4 的老版 Vue 2 项目中使用 “markstream-vue2” 库。它能确保 CSS 正常工作,并为一些可能不兼容的现代功能提供替代方案。

适用场景

  • ✓当你的 Vue 2 项目使用的是 Vue CLI 或 Webpack 4 时。
  • ✓如果你无法使用 “package export maps” 或 “Vite worker imports” 等现代功能时。
  • ✓想在不破坏现有项目的前提下集成 “markstream-vue2” 时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-vue2-cli/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/markstream-vue2-cli/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的 Vue 2 项目用的是 Webpack 4,要怎样使用 markstream-vue2?”

每周 5 个新技能,1 分钟读完。

工作原理

工具会调整 “markstream-vue2” 的导入和配置方式,使其适配 Vue CLI 和 Webpack 4 的限制。它会单独导入 CSS,并为 workers 等功能提供替代方案。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Markstream Vue 2 CLI

Overview

Handle Vue CLI and Webpack 4 constraints that differ materially from modern Vue 2/Vite setup.

When to Use

Use when Vue 2 runs on Vue CLI or Webpack 4 and package export maps or Vite worker imports are unavailable.

Workflow

Inspect the existing package manager, installed package version and project conventions. A requested scoped integration already authorizes routine source/dependency edits; seek approval only for a material scope expansion or unresolved beta/alpha adoption decision.

  1. Confirm Vue 2 plus Vue CLI/Webpack 4.
  2. Install markstream-vue2 and only requested peers.
  3. Import markstream-vue2/dist/index.css, because legacy tooling may not understand the CSS export map.
  4. Avoid ?worker imports. Use Markstream CDN worker helpers for KaTeX or Mermaid only when needed.
  5. Prefer stream-markdown code blocks over fragile Monaco worker wiring.
  6. Keep content with smooth streaming for chat; set final and disable pacing/cursor for completed history.
  7. Keep HTML safe and Mermaid strict; validate the actual legacy build.

Example

<script>
import MarkdownRender from 'markstream-vue2'
// Legacy Webpack may not resolve the package CSS export map.
import 'markstream-vue2/dist/index.css'

export default {
  components: { MarkdownRender },
  data: () => ({ content: '# Answer', done: false }),
}
</script>

<template>
  <MarkdownRender
    :content="content"
    :final="done"
    :fade="false"
  />
</template>

Limitations

  • CDN workers require network access and compatible content-security policy.
  • Monaco-style worker setups are intentionally not covered.
  • Vue 2.6 may also require @vue/composition-api.

Security & Safety Notes

Do not introduce CDN workers without reviewing CSP, network policy, and dependency trust. Preserve safe rendering defaults.

Verify props, export paths and peer ranges against the installed package, not a mutable upstream main. Test partial and completed streams, malformed/untrusted Markdown, links and image URLs, cancellation and reduced motion. Safe HTML and strict diagrams reduce exposure but do not alone enforce URL/network privacy or application component permissions.

Vue 2 is end-of-life; preserve a requested legacy integration and document its maintenance/support decision rather than silently upgrading the whole application. Prefer reviewed locally bundled workers over mutable CDN code where feasible.

常见问题

什么是 “package export maps”?

它是一种更现代的方式,用来组织和导入 JavaScript 库的各个部分。老项目可能无法识别这种组织方式。

什么是 “CDN worker fallbacks”?

这是一些备用方案:如果主要方法在你的环境中行不通,就用从互联网(CDN)下载的代码来执行某些任务,比如渲染数学公式。

为什么要使用 “conservative code-block defaults”?

意思是工具会对代码块采用更保守、更简单的默认设置,以避免老环境中可能出现的兼容或安全问题。

详情

作者的原始描述

Integrate markstream-vue2 into Vue CLI or Webpack 4 with export-map-safe CSS, CDN worker fallbacks, and conservative code-block defaults.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5175
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能