types(cli): fit typescript@4.1

This commit is contained in:
chenjiahan
2020-11-21 21:15:10 +08:00
parent 265ca82686
commit 23e647805a
5 changed files with 7 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ import { readFileSync, removeSync, outputFileSync } from 'fs-extra';
import { replaceExt } from '../common';
import { replaceCssImport } from '../common/css';
export function compileJs(filePath: string): Promise<undefined> {
export function compileJs(filePath: string): Promise<void> {
return new Promise((resolve, reject) => {
let code = readFileSync(filePath, 'utf-8');

View File

@@ -2,7 +2,7 @@ import webpack from 'webpack';
import { getPackageConfig } from '../config/webpack.package';
export async function compilePackage(isMinify: boolean) {
return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
const config = getPackageConfig(isMinify);
webpack(config, (err, stats) => {

View File

@@ -54,7 +54,7 @@ function watch() {
}
function build() {
return new Promise((resolve, reject) => {
return new Promise<void>((resolve, reject) => {
const config = getSitePrdConfig();
webpack(config, (err, stats) => {

View File

@@ -93,7 +93,7 @@ function getSequence(components: string[], depsMap: DepsMap) {
export async function genStyleDepsMap() {
const components = getComponents();
return new Promise(resolve => {
return new Promise<void>(resolve => {
clearDepsCache();
const map = {} as DepsMap;