Skip to content

Commit 2f4504f

Browse files
fix: fix build issues
1 parent 53afb73 commit 2f4504f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/packages/lowcoder/src/base/codeEditor/autoFormat.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ import { format as formatSQL } from "sql-formatter";
55
import { Language } from "./codeEditorTypes";
66

77
export async function cssFormatter(text: string) {
8-
const prettier = await import("prettier/standalone");
8+
const prettier = await require("prettier/standalone");
99
const parserPlugin = await require("prettier/parser-postcss");
1010
return (await prettier.format(text, { parser: "css", plugins: [parserPlugin], semi: false })).trim();
1111
}
1212

1313
export async function htmlFormatter(text: string) {
14-
const prettier = await import("prettier/standalone");
14+
const prettier = await require("prettier/standalone");
1515
const parserPlugin = await require("prettier/parser-html");
1616
return (await prettier.format(text, { parser: "html", plugins: [parserPlugin], semi: false })).trim();
1717
}
1818

1919
async function getJavascriptFormatter() {
20-
const prettier = await import("prettier/standalone");
20+
const prettier = await require("prettier/standalone");
2121
const parserBabel = await require("prettier/parser-babel");
2222
return async (text: string) =>
2323
(await prettier.format(text, { parser: "babel", plugins: [parserBabel], semi: false })).trim();
2424
}
2525

2626
export async function getJsonFormatter() {
27-
const prettier = await import("prettier/standalone");
27+
const prettier = await require("prettier/standalone");
2828
const parserBabel = await require("prettier/parser-babel");
2929
return async (text: string) => (await prettier.format(text, { parser: "json", plugins: [parserBabel] })).trim();
3030
}

0 commit comments

Comments
 (0)