html-inline-css-webpack-plugin weekly downloads statistics
By Runjuu · npm · Webpack plugins
☄️ A webpack plugin for convert external stylesheet to embedded stylesheet, aka document stylesheet
html-inline-css-webpack-plugin has 24,653 recorded weekly downloads on npm, a decrease of 22.1% over the past 30 days, ranking #738 of 2,322 tracked listings.
About html-inline-css-webpack-plugin
html-inline-css-webpack-plugin
Convert external stylesheet to embedded stylesheet, aka document stylesheet.
<link rel="stylesheet" /> => <style>...<style/>
Require mini-css-extract-plugin and html-webpack-plugin
Install
NPM
npm i html-inline-css-webpack-plugin -D
Yarn
yarn add html-inline-css-webpack-plugin -D
Minimal example
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HTMLInlineCSSWebpackPlugin = require("html-inline-css-webpack-plugin").default;
module.exports = {
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
}),
new HtmlWebpackPlugin(),
new HTMLInlineCSSWebpackPlugin(),
],
module: {
rules: [
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader"
]
}
]
}
}
Config
interface Config {
filter?: (fileName: string) => boolean
styleTagFactory?: (params: { style: string }) => string
leaveCSSFile?: boolean
replace?: {
target: string
position?: 'before' | 'after'
removeTarget?: boolean
}
}
filter(optional)
filter?: (fileName: string) => boolean
Return true to make current file internal, otherwise ignore current file. Include both css file and html file name.
example
...
new HTMLInlineCSSWebpackPlugin({
filter(fileName) {
return fileName.includes('main');
},
}),
...
styleTagFactory(optional)
styleTagFactory?: (params: { style: string }) => string
Used to customize the style tag.
example
...
new HTMLInlineCSSWebpackPlugin({
styleTagFactory({ style }) {
return `<style type="text/css">${style}</style>`;
},
}),
...
leaveCSSFile(optional)
if true, it will leave CSS files where they are when inlining
replace(optional)
replace?: {
target: string
position?: 'before' | 'after' // default is 'before'
removeTarget?: boolean // default is false
}
A config for customizing the location of injection, default will add internal style sheet before the </head>
target
A target for adding the internal style sheet
position(optional)
Add internal style sheet before/after the target
removeTarget(optional)
if true, it will remove the target from the output HTML
Please note that HTML comment is removed by default by the
html-webpack-pluginin production mode. #16
example
<head>
<!-- inline_css_plugin -->
<style>
/* some hard code style */
</style>
</head>
...
new HTMLInlineCSSWebpackPlugin({
replace: {
removeTarget: true,
target: '<!-- inline_css_plugin -->',
},
}),
...
output:
<head>
<style>
/* style from *.css files */
</style>
<style>
/* some hard code style */
</style>
</head>
Description from the npm listing.
- webpack
- webpack4
- webpack5
- webpack-plugin
- inline
- internal
- embedded
- document
- css
- style
- stylesheet
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Webpack plugins plugins
All 20 html-inline-css-webpack-plugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/html-inline-css-webpack-plugin. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.