Skip to content

Commit 2122daf

Browse files
committed
use clean-css again
1 parent 454a189 commit 2122daf

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

scripts/build.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import fs from 'fs'
22
import postcss from 'postcss'
33
import tailwind from '..'
44
import CleanCSS from 'clean-css'
5-
import cssnano from 'cssnano'
65

76
function buildDistFile(filename, config = {}, outFilename = filename) {
87
return new Promise((resolve, reject) => {
@@ -21,13 +20,8 @@ function buildDistFile(filename, config = {}, outFilename = filename) {
2120
return result
2221
})
2322
.then((result) => {
24-
return postcss([cssnano]).process(result.css, {
25-
from: `./${filename}.css`,
26-
to: `./dist/${outFilename}.min.css`,
27-
})
28-
})
29-
.then((result) => {
30-
fs.writeFileSync(`./dist/${outFilename}.min.css`, result.css)
23+
const minified = new CleanCSS().minify(result.css)
24+
fs.writeFileSync(`./dist/${outFilename}.min.css`, minified.styles)
3125
})
3226
.then(resolve)
3327
.catch((error) => {

0 commit comments

Comments
 (0)