@zilero/gulp-pug-compiler
Version:
A Gulp plugin for compiling Pug templates to HTML with support for layouts, includes, and custom options
97 lines (69 loc) ⢠2.37 kB
Markdown
<div align="center">
<img src="https://readme-typing-svg.demolab.com?font=Montserrat&weight=700&size=35&duration=3000&pause=1000&color=CF4647&background=45FF0000¢er=true&vCenter=true&width=600&height=70&lines=Gulp+Pug+Compiler;Fast+%26+Flexible;Smart+Pug+Compilation" alt="Typing SVG" />
šļø Powerful Gulp plugin for Pug template compilation with hooks support.
[](
[](
[](
</div>
- š Pug to HTML compilation
- š Pre and post compilation hooks
- š TypeScript support
- š Stream-based processing
- š” Progress logging
- š ļø Full Pug options support
```bash
npm install @zilero/gulp-pug-compiler --save-dev
yarn add @zilero/gulp-pug-compiler --dev
pnpm add @zilero/gulp-pug-compiler --save-dev
```
- Type: `Options` (from pug)
- Required: `false`
- Pug compilation options
- Type: `object`
- Required: `false`
- Type: `(content: string) => Promise<string> | string`
- Required: `false`
- Transform content after compilation
```typescript
gulp.task('advanced-compile', () => {
return gulp.src('src/**/*.pug')
.pipe(GulpPugCompiler({
pugOptions: {
pretty: true,
doctype: 'html',
locals: {
title: 'My Website'
}
},
pluginOptions: {
onAfterCompile: (content) => {
// Custom post-processing
return content;
}
}
}))
.pipe(gulp.dest('dist'));
});
```
[](CONTRIBUTING.md)
If you would like to contribute to the project, please create a pull request or leave feedback. We are always open to new ideas and improvements!
[](https://github.com/zilero/gulp-plugins-hub/issues)
Found a bug? Want to request a feature? Please create an issue.
[](LICENSE)
This project is licensed under the MIT License. See the LICENSE file for details.
---
<div align="center">
Made with ā¤ļø by [Zilero](https://github.com/zilero)
</div>