File tree 1 file changed +6
-4
lines changed
packages/purgecss-webpack-plugin/__tests__
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
import * as path from "path" ;
2
2
import fs from "fs" ;
3
3
import { promisify } from "util" ;
4
- import webpack , { Configuration , Stats } from "webpack" ;
4
+ import webpack , { Configuration } from "webpack" ;
5
5
6
6
const asyncFs = {
7
7
readdir : promisify ( fs . readdir ) ,
8
8
} ;
9
9
10
- function runWebpack ( options : Configuration ) : Promise < webpack . Stats > {
10
+ function runWebpack (
11
+ options : Configuration
12
+ ) : Promise < webpack . Stats | undefined > {
11
13
const compiler = webpack ( options ) ;
12
- return new Promise < webpack . Stats > ( ( resolve , reject ) => {
13
- compiler . run ( ( err ?: Error , stats ?: Stats ) => {
14
+ return new Promise ( ( resolve , reject ) => {
15
+ compiler . run ( ( err , stats ) => {
14
16
if ( err ) reject ( err ) ;
15
17
if ( stats ?. hasErrors ( ) ) reject ( new Error ( stats . toString ( ) ) ) ;
16
18
resolve ( stats ) ;
You can’t perform that action at this time.
0 commit comments