Skip to content

Commit

Permalink
use clean-css again
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Sep 8, 2021
1 parent 454a189 commit 2122daf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from 'fs'
import postcss from 'postcss'
import tailwind from '..'
import CleanCSS from 'clean-css'
import cssnano from 'cssnano'

function buildDistFile(filename, config = {}, outFilename = filename) {
return new Promise((resolve, reject) => {
Expand All @@ -21,13 +20,8 @@ function buildDistFile(filename, config = {}, outFilename = filename) {
return result
})
.then((result) => {
return postcss([cssnano]).process(result.css, {
from: `./${filename}.css`,
to: `./dist/${outFilename}.min.css`,
})
})
.then((result) => {
fs.writeFileSync(`./dist/${outFilename}.min.css`, result.css)
const minified = new CleanCSS().minify(result.css)
fs.writeFileSync(`./dist/${outFilename}.min.css`, minified.styles)
})
.then(resolve)
.catch((error) => {
Expand Down

0 comments on commit 2122daf

Please sign in to comment.