Skip to content

Commit 9979f42

Browse files
authored
Merge pull request #568 from raheeliftikhar5/build-fix
Fix build issues
2 parents 53afb73 + d516538 commit 9979f42

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

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

Lines changed: 5 additions & 5 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
}
@@ -130,7 +130,7 @@ async function formatJsonWithJsSnippetsImpl(text: string) {
130130
return segment;
131131
}));
132132

133-
return (await formattedJSON).replace(/("{{\d+}}")|({{\d+}})|(\\\\{\\\\{\d+\\\\}\\\\})/g, (s) => {
133+
return (await formattedJSON).replace(/("{{\d+}}")|({{\d+}})|(\\\\{\\\\{\d+\\\\}\\\\})/g, (s: string) => {
134134
const index = parseInt(
135135
s.startsWith('"{{') ? s.slice(3, -3) : s.startsWith("{{") ? s.slice(2, -2) : s.slice(6, -6)
136136
);

client/yarn.lock

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12328,21 +12328,6 @@ __metadata:
1232812328
languageName: unknown
1232912329
linkType: soft
1233012330

12331-
"lowcoder-hillcharts@workspace:packages/lowcoder-hillcharts":
12332-
version: 0.0.0-use.local
12333-
resolution: "lowcoder-hillcharts@workspace:packages/lowcoder-hillcharts"
12334-
dependencies:
12335-
"@types/react": 17
12336-
"@types/react-dom": 17
12337-
lowcoder-dev-utils: ^0.0.6
12338-
lowcoder-sdk: ^2.1.9
12339-
react: 17
12340-
react-dom: 17
12341-
typescript: 5.3.3
12342-
vite: ^5.0.6
12343-
languageName: unknown
12344-
linkType: soft
12345-
1234612331
"lowcoder-plugin-demo@workspace:packages/lowcoder-plugin-demo":
1234712332
version: 0.0.0-use.local
1234812333
resolution: "lowcoder-plugin-demo@workspace:packages/lowcoder-plugin-demo"

0 commit comments

Comments
 (0)