Skip to content

Commit

Permalink
Merge pull request #20 from Topthinking/master
Browse files Browse the repository at this point in the history
remove 运行包的chalk
  • Loading branch information
Topthinking committed Jan 10, 2020
2 parents d1480a6 + bf28099 commit 38da3a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
17 changes: 17 additions & 0 deletions packages/award-scripts/src/tools/server/server.ts
Expand Up @@ -6,6 +6,7 @@ import * as https from 'https';
import { List } from 'immutable';
import * as fs from 'fs-extra';
import * as path from 'path';
import * as chalk from 'chalk';
import { renderToString } from 'react-dom/server';
import { Helmet as Head } from 'react-helmet';
import { getBundles } from 'react-loadable/webpack';
Expand Down Expand Up @@ -270,4 +271,20 @@ export default class DevServer extends Server {
public createRouter() {
super.createRouter(remove);
}

/**
* hook log
*/
public log(cb: Function) {
if (this.dev) {
console.warn(
chalk.red(
`${chalk.yellow('[development]')} 为了表意准确请使用${chalk.green(
'app.catch'
)}替换app.log,使用方式一致,未来我们会废除app.log`
)
);
}
super.log(cb);
}
}
10 changes: 0 additions & 10 deletions packages/award-server/src/server/base.ts
Expand Up @@ -2,7 +2,6 @@
* Server对象的基础类
*/
import * as Koa from 'koa';
import * as chalk from 'chalk';
import { Seq, List, fromJS } from 'immutable';
import * as fs from 'fs-extra';
import * as Path from 'path';
Expand Down Expand Up @@ -259,15 +258,6 @@ export default class Base {
}

public log(cb: Function) {
if (this.dev) {
console.warn(
chalk.red(
`${chalk.yellow('[development]')} 为了表意准确请使用${chalk.green(
'app.catch'
)}替换app.log,使用方式一致,未来我们会废除app.log`
)
);
}
this.handleError(cb);
}

Expand Down

0 comments on commit 38da3a3

Please sign in to comment.