Skip to content

Commit

Permalink
chore: add node build lib config file tips
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost committed Sep 29, 2024
1 parent 9eb4190 commit 60f825f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ export async function loadConfigFile(
// `Failed to load farm config file: ${errorMessage}. \n ${potentialSolution} \n ${error.stack}`
// );
throw new Error(
`Failed to load farm config file: ${errorMessage}. \n ${potentialSolution} \n ${error.stack}`
`Failed to load farm config file: ${errorMessage}. \n ${potentialSolution}`
// `Failed to load farm config file: ${errorMessage}.`,
);
}
Expand Down
10 changes: 9 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
} from './compiler/utils.js';
import { __FARM_GLOBAL__ } from './config/_global.js';
import type { FarmCliOptions, ResolvedUserConfig } from './config/types.js';
import { getShortName } from './utils/path.js';

// export async function start(
// inlineConfig?: FarmCliOptions & UserConfig
Expand Down Expand Up @@ -309,12 +310,19 @@ export async function build(
? bold(PersistentCacheBrand)
: '';

compiler.writeResourcesToDisk();
const shortFile = getShortName(
resolvedUserConfig.configFilePath,
resolvedUserConfig.root
);
resolvedUserConfig.logger.info(
`Using config file at ${bold(green(shortFile))}`
);
resolvedUserConfig.logger.info(
`Build completed in ${bold(
green(`${elapsedTime}ms`)
)} ${persistentCacheText} Resources emitted to ${bold(green(output.path))}.`
);
compiler.writeResourcesToDisk();
await copyPublicDirectory(resolvedUserConfig);
} catch (err) {
resolvedUserConfig.logger.error(`Failed to build: ${err}`, { exit: true });
Expand Down

0 comments on commit 60f825f

Please sign in to comment.