mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
docs(prettier): format in worker like on ssr
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user