Fang plugin for pug.
- Install fang
npm install --save-dev @khalyomede/fang@0.*
- Install this package
npm install --save-dev @khalyomede/fang-pug@0.*
- Add a script alias
// package.json
{
"scripts": {
"fang": "fang"
}
}
- Add a task file (at the root of your folder)
// fang.js
const fang = require('@khalyomede/fang');
const pug = require('@khalyomede/fang-pug');
const html = () => fang.from('src/**/*.pug')
.do(pug())
.save('dist');
const build = [html];
module.exports = { build };
In this example, we will render our pug file into html files.
// fang.js
const fang = require('@khalyomede/fang');
const pug = require('@khalyomede/fang-pug');
const html = () => fang.from('src/**/*.pug')
.do(pug())
.save('dist');
const build = [html];
module.exports = { build };
In this example, we will use pug options to customize the behavior of this package.
// fang.js
const fang = require('@khalyomede/fang');
const pug = require('@khalyomede/fang-pug');
const html = () => fang.from('src/**/*.pug')
.do(pug({
pretty: true // Add pretty-indentation whitespace to the file content
}))
.save('dist');
const build = [html];
module.exports = { build };