docs(prettier): format in worker like on ssr

This commit is contained in:
Benjamin Canac
2024-09-24 12:40:22 +02:00
parent cac33c87b2
commit 7bd06ecfd9

View File

@@ -1,7 +1,10 @@
/* eslint-disable no-undef */
import('https://unpkg.com/prettier@3.3.3/standalone.js')
import('https://unpkg.com/prettier@3.3.3/plugins/babel.js')
import('https://unpkg.com/prettier@3.3.3/plugins/estree.js')
import('https://unpkg.com/prettier@3.3.3/plugins/html.js')
import('https://unpkg.com/prettier@3.3.3/plugins/markdown.js')
import('https://unpkg.com/prettier@3.3.3/plugins/typescript.js')
self.onmessage = async function (event) {
self.postMessage({
@@ -19,6 +22,7 @@ function handleMessage(message) {
async function handleFormatMessage(message) {
const { options, source } = message
const formatted = await prettier.format(source, {
parser: 'markdown',
plugins: prettierPlugins,