Skip to content

Instantly share code, notes, and snippets.

@GrandSchtroumpf
Created May 7, 2020 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GrandSchtroumpf/055e65f118e4c94c676f4494cd7a5d20 to your computer and use it in GitHub Desktop.
Save GrandSchtroumpf/055e65f118e4c94c676f4494cd7a5d20 to your computer and use it in GitHub Desktop.
Markdium-VSCode extension inside a nx workspace
const index = join(context.extensionPath, 'studio/index.html');
// Refresh the webview on update from the code
const updateWebview = async () => {
const html = await fs.readFile(index, 'utf-8');
panel.webview.html = html.replace(matchLinks, toUri);
}
// In dev mode listen on changes from index.html & update the view
if (!environment.production) {
watch(index).on('change', updateWebview)
}
// First render
updateWebview();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment