chore: Add live editor build script for previews

This commit is contained in:
Sidharth Vinod
2023-08-25 00:12:14 +05:30
parent 2ab393cd16
commit 54de763a66

23
scripts/editor.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# We have to use npm instead of yarn because it causes trouble in netlify
# Link local mermaid to npm
pushd packages/mermaid || exit
npm link
popd || exit
# Clone the Mermaid Live Editor repository
git clone https://github.com/mermaid-js/mermaid-live-editor.git
# Change to the repository directory
cd mermaid-live-editor || exit
# Link local mermaid to live editor
npm link mermaid
# Install dependencies
npm install
# Build the site
npm run build