Crates.io | pug_tmp_workaround |
lib.rs | pug_tmp_workaround |
version | 0.0.3 |
source | src |
created_at | 2019-03-24 23:43:56.156145 |
updated_at | 2019-03-26 04:38:55.726538 |
description | pug.js reimplemented in rust for speed |
homepage | |
repository | https://github.com/aep/pug-rs |
max_upload_size | |
id | 123604 |
size | 11,005 |
reimplemented in rust for performance reasons.
pug.js | pug-rs |
---|---|
780ms | 29ms |
$ cargo install pug
$ pug < thing.pug > thing.html
pug_loader.js:
const spawnSync = require('child_process').spawnSync;
module.exports = function(source) {
var proc = spawnSync("pug", {
input: source
});
if (proc.status != 0) {
throw proc.error;
}
return proc.stdout.toString();
}
module: {
rules: [
{
test: /\.pug$/,
use: [require.resolve('./pug_loader.js')]
},