Gulp Html Src

screenshot of Gulp Html Src

Gulp plugin to emit all the <script> or <link rel="stylesheet"> files.

Overview

The gulp-html-src tool is an impressive utility for developers looking to streamline their workflow when processing HTML files in a Gulp.js environment. It efficiently converts HTML input by extracting all linked script or CSS files while maintaining the integrity of the original HTML. This capability can facilitate project clean-up and assist with managing dependencies in a structured manner.

What sets gulp-html-src apart is its support for streams, allowing for both Buffer and stream inputs and outputs. This flexibility enhances its applicability across various project setups, making it a valuable addition to any developer's toolkit.

Features

  • Stream Support: Handles both streams and buffers seamlessly, providing flexibility in input-output operations.
  • Presets Option: Choose between extracting script or CSS files, accommodating different project requirements.
  • Selective Tag Removal: Skips any script or link tags with data-remove="true" or data-ignore="true", giving developers control over what gets processed.
  • Keep Original HTML: Option to include the original HTML file in the output stream, enabling easy copying and reference retention.
  • Custom Selector Capabilities: Utilize a jQuery-like selector to extract specific elements beyond just scripts and styles, such as images.
  • Filename Generation Function: Offers a customizable function to determine how the selected elements are converted into filenames, streamlining organization.
  • Advanced Option Flexibility: Supports advanced configurations for specific use cases, allowing developers to fine-tune functionality for their unique needs.
gulp
Gulp

Gulp.js is an old but popular site building tool that automates various repetitive development tasks in web development, such as compiling Sass, minifying JavaScript, and optimizing images.