
Research
/Security News
GlassWASM: WebAssembly Malware Found in Trojanized Open VSX Extensions
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.
@hyperse/html-webpack-plugin-loader
Advanced tools
A custom template loader that parses HTML templates for the `html-webpack-plugin` package
A powerful HTML template parser and manipulator for webpack applications, providing a fluent API for modifying HTML templates with ease.
A TypeScript-based HTML template parser that provides a fluent API for manipulating HTML documents. This package is designed to work seamlessly with webpack applications, allowing you to easily modify HTML templates during the build process.
npm install --save @hyperse/html-webpack-plugin-loader
The main class that provides HTML template manipulation capabilities.
import { TemplateParser } from '@hyperse/html-webpack-plugin-loader';
// Create a new parser instance
const parser = new TemplateParser(htmlSource);
// Define template options
const templateOptions: TemplateOptions = {
// Set page title
title: 'My Page Title',
// Set website favicon
favicon: '/favicon.ico',
// Set meta tags in head
headMetaTags: ['<meta name="description" content="My page description">'],
// Set styles in head
headStyles: ['<style>body { margin: 0; }</style>'],
// Set scripts in head
headScripts: [
{
id: 'main-js', // Required: Unique script identifier
src: '/main.js', // Required: Script source path
position: 'end', // Required: Script position in head
type: 'text/javascript', // Optional: Script type
async: true, // Optional: Load script asynchronously
defer: false, // Optional: Defer script loading
order: 1, // Optional: Loading order
},
],
// Set inline scripts in head
headInlineScripts: [
{
id: 'inline-script', // Required: Unique script identifier
position: 'end', // Required: Script position in head
content: 'console.log("Hello");', // Required: Script content
order: 2, // Optional: Loading order
},
],
// Set scripts in body
bodyScripts: [
{
id: 'app-js', // Required: Unique script identifier
src: '/app.js', // Required: Script source path
position: 'end', // Required: Script position in body
type: 'text/javascript', // Optional: Script type
async: true, // Optional: Load script asynchronously
defer: false, // Optional: Defer script loading
order: 1, // Optional: Loading order
},
],
};
// Use template options to modify HTML
const modifiedHtml = parser
.upsertTitleTag(templateOptions.title)
.upsertFaviconTag(templateOptions.favicon)
.upsertHeadMetaTags(templateOptions.headMetaTags)
.upsertHeadStyles(templateOptions.headStyles)
.upsertHeadScripts(templateOptions.headScripts)
.upsertHeadInlineScripts(templateOptions.headInlineScripts)
.upsertBodyScripts(templateOptions.bodyScripts)
.serialize();
upsertTitleTag(title: string): Updates or inserts the page titleupsertFaviconTag(favicon: string): Updates or inserts the favicon linkupsertHeadMetaTags(tags: string[]): Updates or inserts meta tags in the headupsertHeadStyles(styles: string[]): Updates or inserts style tags in the headupsertHeadScripts(scripts: ScriptItem[]): Updates or inserts script tags in the headupsertHeadInlineScripts(scripts: string[]): Updates or inserts inline scripts in the headupsertBodyScripts(scripts: ScriptItem[]): Updates or inserts script tags in the bodyserialize(): Converts the modified document back to HTML stringContributions are welcome! Please read our contributing guidelines before submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A custom template loader that parses HTML templates for the `html-webpack-plugin` package
The npm package @hyperse/html-webpack-plugin-loader receives a total of 13 weekly downloads. As such, @hyperse/html-webpack-plugin-loader popularity was classified as not popular.
We found that @hyperse/html-webpack-plugin-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.