Skip to content

Commit

Permalink
Use minify instead of minifier
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-dale committed May 1, 2022
1 parent 423b239 commit db159d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
6 changes: 0 additions & 6 deletions scripts/release.js
Original file line number Diff line number Diff line change
@@ -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'));

0 comments on commit db159d3

Please sign in to comment.