Skill

Render streaming Markdown in legacy Vue 2 CLI projects

Integrates Markstream's streaming markdown renderer into Vue 2 projects still on Vue CLI or Webpack 4, avoiding Vite-only worker imports.

Works with vuewebpackvite

80
Spark score
out of 100
Updated 3 days ago
Version 15.3.0

Add to Favorites

Why it matters

Integrate real-time Markdown rendering with streaming support into Vue 2 applications constrained by Vue CLI and Webpack 4 tooling, where modern package export maps and Vite worker imports are unavailable.

Outcomes

What it gets done

01

Import and configure markstream-vue2 component with legacy CSS paths for Webpack 4 compatibility

02

Stream Markdown content smoothly for chat interfaces with pacing and cursor controls

03

Render completed Markdown history by setting final state and disabling streaming effects

04

Validate builds against legacy tooling constraints while maintaining safe HTML rendering defaults

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-markstream-vue2-cli | bash

Overview

Markstream Vue 2 CLI

Integrates Markstream's streaming markdown renderer into a legacy Vue 2 project on Vue CLI or Webpack 4, working around missing export-map and worker-import support. Use when Vue 2 runs on Vue CLI or Webpack 4 and Vite-style worker imports or CSS export maps aren't available.

What it does

This skill handles Vue CLI and Webpack 4 constraints for Markstream Vue 2 integration that differ materially from a modern Vue 2/Vite setup. Its workflow: before changing dependencies or source files, inspect the existing package manager and project conventions, preview the intended edits, and get explicit user approval; confirm the project is actually Vue 2 plus Vue CLI/Webpack 4; install markstream-vue2 and only the specifically requested peer dependencies; import markstream-vue2/dist/index.css directly, since legacy tooling may not understand the package's CSS export map; avoid ?worker imports, using Markstream's CDN worker helpers for KaTeX or Mermaid only when actually needed; prefer stream-markdown code blocks over fragile Monaco worker wiring; keep the content prop streaming smoothly for chat, then set final and disable pacing/cursor for completed history; and keep HTML rendering safe and Mermaid strict, validating against the actual legacy build.

Documented limitations: CDN workers require network access and a compatible content-security policy, Monaco-style worker setups are intentionally not covered, and Vue 2.6 may also require @vue/composition-api. A security note: do not introduce CDN workers without reviewing CSP and network policy, and preserve safe rendering defaults.

When to use - and when NOT to

Use when Vue 2 runs on Vue CLI or Webpack 4 and package export maps or Vite worker imports are unavailable. Do not use its Monaco-style worker guidance - that setup is intentionally out of scope here.

Inputs and outputs

Input is an existing Vue 2 + Vue CLI/Webpack 4 project. Output is a working MarkdownRender integration importing markstream-vue2's CSS directly, bypassing the export map, using CDN worker helpers instead of ?worker imports, and streaming content safely.

<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>

Who it's for

Developers integrating Markstream's streaming markdown renderer into a legacy Vue 2 project still on Vue CLI or Webpack 4, where modern Vite-based worker imports and CSS export maps don't work.

Source README

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

Before changing dependencies or source files, inspect the existing package manager and project conventions, preview the intended edits, and obtain explicit user approval.

  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.

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.