
Create a gulp stream from script, link, or any set of tags in an HTML file.
Gulp-dom-src is an incredibly handy tool for web developers looking to streamline their build processes. It allows you to create a Gulp stream directly from scripts, links, or any set of tags within an HTML file. This functionality simplifies the task of managing dependencies and allows for efficient concatenation and minification of assets—all while maintaining the flexibility required for modern web development.
The integration capabilities of Gulp-dom-src make it a superior choice for those who want to enhance their build workflow. By utilizing selectors and attributes directly in your HTML files, developers can easily control which scripts and styles are included in their build process without having to modify the underlying file paths manually.
Flexible Configuration: Specify the HTML file to read tags through the config.fileType parameter, enabling targeted asset management.
CSS Selectors Support: Use any valid CSS selector with config.selector to include or exclude script and link tags based on complex logic.
Custom Attribute Control: Define the attribute that contains the file path with config.attribute, ensuring accurate references to external scripts and styles.
Relative Path Handling: Set a custom working directory with config.cwd to manage file references relative to your HTML, enhancing versatility in projects.
Duplex Streaming: The domSrc.duplex(config) feature allows HTML files to be piped in and outputs linked scripts or styles, making the workflow seamless.
Option Customization: Pass additional options to the underlying vinyl-fs via config.options, providing even more fine-tuned control over file handling during the build process.
Concatenation & Minification: When combined with gulp-cheerio, it delivers a full concatenation and minification workflow, streamlining asset management.
These features work together to provide developers with the tools needed to optimize their build processes efficiently, making Gulp-dom-src a powerful addition to any front-end workflow.
