rerumaccusamus
Version:
The meta-framework suite designed from scratch for frontend-focused modern web development.
28 lines (21 loc) • 662 B
text/typescript
import { chalk, logger } from '@modern-js/utils';
import { IAppContext, NormalizedConfig } from '@modern-js/core';
export const startTimer = {
start: 0,
end: 0,
};
export const dev = async (
config: NormalizedConfig,
appContext: IAppContext,
) => {
logger.log(chalk.cyanBright(`Starting the development server...\n`));
startTimer.start = Date.now();
const [{ startDevServer }, { createHtml }] = await Promise.all([
import('./server'),
import('./create-entry'),
]);
// create html template for each js entry
createHtml(config, appContext);
const closeServer = await startDevServer(config, appContext);
return closeServer;
};