mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
feat: 优化fes命令的速度
编写命令时,比较大的库需要使用require的方式按需加载
This commit is contained in:
parent
25efdcd1fc
commit
f8c03ff00f
@ -1,4 +1,4 @@
|
||||
import { runCLI } from 'jest';
|
||||
|
||||
import assert from 'assert';
|
||||
import { join } from 'path';
|
||||
import { existsSync } from 'fs';
|
||||
@ -71,6 +71,8 @@ export default function (api) {
|
||||
}, {});
|
||||
args.debug && logger.log(`config from args: ${JSON.stringify(argsConfig)}`);
|
||||
|
||||
// 比较大的库建议使用require,使用时才加载,提升fes命令的效率
|
||||
const { runCLI } = require('jest');
|
||||
// Run jest
|
||||
const result = await runCLI(
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { Server } from '@umijs/server';
|
||||
import { delay } from '@umijs/utils';
|
||||
import assert from 'assert';
|
||||
import { delay } from '@umijs/utils';
|
||||
import {
|
||||
cleanTmpPathExceptCache,
|
||||
getBundleAndConfigs
|
||||
@ -171,6 +170,8 @@ export default (api) => {
|
||||
args: {}
|
||||
});
|
||||
|
||||
const { Server } = require('@umijs/server');
|
||||
|
||||
server = new Server({
|
||||
...opts,
|
||||
compress: true,
|
||||
|
@ -1,18 +1,15 @@
|
||||
|
||||
|
||||
import envinfo from 'envinfo';
|
||||
|
||||
export default function (api) {
|
||||
api.registerCommand({
|
||||
command: 'info',
|
||||
description: 'print debugging information about your environment',
|
||||
async fn() {
|
||||
envinfo.run(
|
||||
require('envinfo').run(
|
||||
{
|
||||
System: ['OS', 'CPU'],
|
||||
Binaries: ['Node', 'Yarn', 'npm'],
|
||||
Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],
|
||||
npmPackages: '/**/{typescript,*vue*,@webank/*/}',
|
||||
npmPackages: ['@webank/fes', 'vue', 'vue-router'],
|
||||
npmGlobalPackages: ['@webank/fes']
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user