mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 02:40:35 +01:00
docs(prettier): format in worker like on ssr
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
/* eslint-disable no-undef */
|
/* eslint-disable no-undef */
|
||||||
import('https://unpkg.com/prettier@3.3.3/standalone.js')
|
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/html.js')
|
||||||
import('https://unpkg.com/prettier@3.3.3/plugins/markdown.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.onmessage = async function (event) {
|
||||||
self.postMessage({
|
self.postMessage({
|
||||||
@@ -19,6 +22,7 @@ function handleMessage(message) {
|
|||||||
|
|
||||||
async function handleFormatMessage(message) {
|
async function handleFormatMessage(message) {
|
||||||
const { options, source } = message
|
const { options, source } = message
|
||||||
|
|
||||||
const formatted = await prettier.format(source, {
|
const formatted = await prettier.format(source, {
|
||||||
parser: 'markdown',
|
parser: 'markdown',
|
||||||
plugins: prettierPlugins,
|
plugins: prettierPlugins,
|
||||||
|
|||||||
Reference in New Issue
Block a user