1
0
mirror of https://github.com/GenderDysphoria/GenderDysphoria.fyi.git synced 2025-11-25 20:42:40 +00:00

Initial site commit

This commit is contained in:
Jocelyn Badgley (Twipped)
2020-02-20 14:38:25 -08:00
parent 0a6bdb2544
commit 1c45fdaf33
136 changed files with 24538 additions and 146 deletions

31
gulp/lib/crass.js Normal file
View File

@@ -0,0 +1,31 @@
const through = require('./through');
const crass = require('crass');
const PluginError = require('plugin-error');
module.exports = exports = function (options) {
options = {
pretty: false,
o1: true,
...options,
};
return through(async (stream, file) => {
if (file.isNull()) {
stream.push(file);
return;
}
try {
var parsed = crass.parse(file.contents.toString());
parsed = parsed.optimize({ O1: !!options.o1 });
if (options.pretty) parsed = parsed.pretty();
file.contents = Buffer.from(parsed.toString());
} catch (err) {
this.emit('error', new PluginError('gulp-crass', err));
}
stream.push(file);
});
};