
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@neutrinojs/html-template
Advanced tools
Neutrino middleware for automatic HTML file generation from metadata
@neutrinojs/html-template
is Neutrino middleware for automatically creating
HTML files for configured entry points.
@neutrinojs/html-template
can be installed via the Yarn or npm clients.
❯ yarn add --dev @neutrinojs/html-template
❯ npm install --save-dev @neutrinojs/html-template
@neutrinojs/html-template
can be consumed from the Neutrino API, middleware,
or presets. Require this package and plug it into Neutrino:
const htmlTemplate = require('@neutrinojs/html-template');
// Usage shows default values
// Accepts options specified by html-webpack-plugin:
// https://github.com/jantimon/html-webpack-plugin#configuration
neutrino.use(
htmlTemplate({
// @neutrinojs/html-template includes a custom template that has more features
// (eg appMountId and lang support) than the default html-webpack-plugin template:
// https://github.com/jantimon/html-webpack-plugin/blob/master/default_index.ejs
template: require.resolve('@neutrinojs/html-template/template.ejs'),
appMountId: 'root',
lang: 'en',
meta: {
viewport: 'width=device-width, initial-scale=1',
},
// Override pluginId to add an additional html-template plugin instance
pluginId: 'html',
}),
);
// Most commonly, you will want to override the initial page title:
neutrino.use(
htmlTemplate({
title: 'React Application',
}),
);
// Using in .neutrinorc.js
const htmlTemplate = require('@neutrinojs/html-template');
// Usage shows default values
// Accepts options specified by html-webpack-plugin:
// https://github.com/jantimon/html-webpack-plugin#configuration
module.exports = {
use: [
htmlTemplate({
// @neutrinojs/html-template includes a custom template that has more features
// (eg appMountId and lang support) than the default html-webpack-plugin template:
// https://github.com/jantimon/html-webpack-plugin/blob/master/default_index.ejs
template: require.resolve('@neutrinojs/html-template/template.ejs'),
appMountId: 'root',
lang: 'en',
meta: {
viewport: 'width=device-width, initial-scale=1',
},
// Override pluginId to add an additional html-template plugin instance
pluginId: 'html',
}),
],
};
// Most commonly, you will want to override the initial page title:
module.exports = {
use: [
htmlTemplate({
title: 'React Application',
}),
],
};
@neutrinojs/html-template
creates some conventions to make overriding the
configuration easier once you are ready to make changes.
The following is a list of plugins and their identifiers which can be overridden:
Name | Description | NODE_ENV |
---|---|---|
html | Automatically generates HTML files for configured entry points. | all |
This middleware is part of the neutrino repository, a monorepo containing all resources for developing Neutrino and its core presets and middleware. Follow the contributing guide for details.
#1652
#1614
#1651
#1638
#1644
#1640
#1612
#1625
#1592
#1626
#1632
#1631
#1629
#1620
#1613
#1618
#1619
#1615
#1650
FAQs
Neutrino middleware for automatic HTML file generation from metadata
The npm package @neutrinojs/html-template receives a total of 990 weekly downloads. As such, @neutrinojs/html-template popularity was classified as not popular.
We found that @neutrinojs/html-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.