chore: fix playground

This commit is contained in:
Rongjian Zhang 2022-06-12 16:40:03 +08:00
parent 27d4de3846
commit 3d2b414fb6
3 changed files with 12 additions and 0 deletions

View File

@ -33,6 +33,14 @@ import { execaCommand } from 'execa'
console.log('build js files...') console.log('build js files...')
await execaCommand('tsc --project tsconfig.svelte.json') await execaCommand('tsc --project tsconfig.svelte.json')
console.log('patch index js...')
let js = await fs.readFile('svelte/index.js', 'utf8')
js = js
.split('\n')
.filter((line) => line.includes('index.scss'))
.join('\n')
await fs.writeFile('svelte/index.js', js)
console.log('processing style files (backward compatibility)...') console.log('processing style files (backward compatibility)...')
await fs.move('dist/style.css', 'dist/index.css') await fs.move('dist/style.css', 'dist/index.css')
await fs.copy('dist/index.css', 'dist/index.min.css') await fs.copy('dist/index.css', 'dist/index.min.css')

View File

@ -20,5 +20,8 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build" "build": "vite build"
},
"devDependencies": {
"vite": "^2.9.12"
} }
} }

View File

@ -10,6 +10,7 @@
import gemoji from '@bytemd/plugin-gemoji' import gemoji from '@bytemd/plugin-gemoji'
import markdownText from './text.md?raw' import markdownText from './text.md?raw'
import 'bytemd/dist/index.css'
import 'highlight.js/styles/vs.css' import 'highlight.js/styles/vs.css'
import 'github-markdown-css' // placed after highlight styles to override `code` padding import 'github-markdown-css' // placed after highlight styles to override `code` padding
import 'katex/dist/katex.css' import 'katex/dist/katex.css'