@@ -5,7 +5,7 @@ import { exec as execCommand } from "child_process";
5
5
import { ncp } from "ncp" ;
6
6
import terser from "terser" ;
7
7
import chokidar from "chokidar" ;
8
- import sass , { Result } from "sass" ;
8
+ import sass from "sass" ;
9
9
import autoprefixer from "autoprefixer" ;
10
10
import postcss from "postcss" ;
11
11
@@ -46,10 +46,7 @@ async function uglify(src: string) {
46
46
} ,
47
47
} ) ;
48
48
49
- if ( minified . error ) {
50
- logErr ( minified . error ) ;
51
- }
52
- return minified . code ;
49
+ return minified . code as string ;
53
50
}
54
51
55
52
async function buildBundleJs ( ) {
@@ -69,16 +66,9 @@ async function buildScripts() {
69
66
}
70
67
71
68
async function transpileStyle ( src : string , compress = false ) {
72
- return new Promise < string > ( ( resolve , reject ) => {
73
- sass . render (
74
- {
75
- file : src ,
76
- outputStyle : compress ? "compressed" : "expanded" ,
77
- } ,
78
- async ( err : Error | undefined , result : Result ) =>
79
- ! err ? resolve ( ( await postcss ( [ autoprefixer ] ) . process ( result . css . toString ( ) ) ) . css ) : reject ( err )
80
- ) ;
81
- } ) ;
69
+ const sassResult = await sass . compileAsync ( src , { style : compress ? "compressed" : "expanded" } ) ;
70
+ const postCssResult = await postcss ( [ autoprefixer ] ) . process ( sassResult . css ) ;
71
+ return postCssResult . css ;
82
72
}
83
73
84
74
async function buildStyle ( ) {
0 commit comments