diff --git a/package.json b/package.json index 1eaa316..4ee9f48 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "compile": "stylus stylus/theme.styl -o build/kernel.css --prefix ke- --include-css", "watch": "stylus -w stylus/theme.styl -o build/kernel.css --prefix ke- --include-css", "lint": "stylint stylus", - "release": "npm run compile && node ./scripts/release.js" + "release": "npm run compile && node ./scripts/release.js && npm run minify", + "minify": "minify ./build/kernel.css > ./release/kernel.min.css && minify ./js/kernel.js > ./release/kernel.min.js" }, "repository": { "type": "git", @@ -26,8 +27,8 @@ }, "homepage": "https://github.com/Ionogy/kernel.css#readme", "dependencies": { + "minify": "^8.0.4", "stylint": "^2.0.0", - "stylus": "^0.56.0", - "minifier": "^0.8.1" + "stylus": "^0.56.0" } } diff --git a/scripts/release.js b/scripts/release.js index 8a20c57..1fe0a78 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -1,16 +1,10 @@ "use strict"; const fs = require('fs'); -const minifier = require('minifier'); if (!fs.existsSync('./release')) { fs.mkdirSync('./release'); } -minifier.on('error', (err) => { - console.error(err); -}); - -minifier.minify('./build/kernel.css', {output: './release/kernel.min.css'}); fs.createReadStream('./build/kernel.css').pipe(fs.createWriteStream('./release/kernel.css')); fs.createReadStream('./js/kernel.js').pipe(fs.createWriteStream('./release/kernel.js'));