Skip to content

Commit a304ac9

Browse files
committed
style: 应用 prettier 格式化 src/compiler 下的源文件
1 parent 4e11e23 commit a304ac9

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

src/compiler/index.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,7 @@ export default async function compile(file: string, compilerOptions: CompilerOpt
291291
* - 原始 cause stack
292292
* 这样 logger 至少能把问题落到本项目文件上,而不仅仅是 Node ESM 内部栈。
293293
*/
294-
function wrapImportError(
295-
sourcePath: string,
296-
outputPath: string,
297-
cause: Error
298-
): Error {
294+
function wrapImportError(sourcePath: string, outputPath: string, cause: Error): Error {
299295
const suspicious = collectSuspiciousImports(outputPath);
300296
const parts: string[] = [
301297
`Failed to import compiled module`,
@@ -363,9 +359,7 @@ export default async function compile(file: string, compilerOptions: CompilerOpt
363359
const content = await moduleGenerator();
364360
fs.writeFileSync(cache.outputPath, content);
365361
try {
366-
cache.resolve(
367-
(await import(pathToFileURL(cache.outputPath).href)) as Module
368-
);
362+
cache.resolve((await import(pathToFileURL(cache.outputPath).href)) as Module);
369363
} catch (importErr) {
370364
const ie = toError(importErr);
371365
const wrapped = wrapImportError(modulePath, cache.outputPath, ie);
@@ -457,9 +451,7 @@ export default async function compile(file: string, compilerOptions: CompilerOpt
457451
fs.writeFileSync(result.resourceOutputPath, writable);
458452
}
459453
try {
460-
cache.resolve(
461-
(await import(pathToFileURL(cache.outputPath).href)) as Module
462-
);
454+
cache.resolve((await import(pathToFileURL(cache.outputPath).href)) as Module);
463455
} catch (importErr) {
464456
const ie = toError(importErr);
465457
throw wrapImportError(resolvedPath, cache.outputPath, ie);

src/compiler/ts-loader.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ export default async function TsLoader(this: LoaderContext, content: LoaderInput
9393
}
9494

9595
const { compile } = await import(
96-
pathToFileURL(
97-
path.join(loader.modulesDir, "@lcui", "react", "lib", "index.js")
98-
).href
96+
pathToFileURL(path.join(loader.modulesDir, "@lcui", "react", "lib", "index.js")).href
9997
);
10098
const options = this.getOptions();
10199
const { dir, name, base } = path.parse(loader.resourcePath);

0 commit comments

Comments
 (0)