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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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.
- Confirm Vue 2 plus Vue CLI/Webpack 4.
- Install
markstream-vue2and only requested peers. - Import
markstream-vue2/dist/index.css, because legacy tooling may not understand the CSS export map. - Avoid
?workerimports. Use Markstream CDN worker helpers for KaTeX or Mermaid only when needed. - Prefer
stream-markdowncode blocks over fragile Monaco worker wiring. - Keep
contentwith smooth streaming for chat; setfinaland disable pacing/cursor for completed history. - 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.
热度
- GitHub 星标
- 48k
- 排名
- #5175
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。