Registry / devops / style-ext-html-webpack-plugin

style-ext-html-webpack-plugin

JSON →
library4.1.3jsnpmunverified

Webpack plugin that converts external CSS links generated by HtmlWebpackPlugin and ExtractTextPlugin or MiniCssExtractPlugin into inline <style> elements in the HTML output. Version 4.1.3 is the final release, supporting Webpack 4.x and HtmlWebpackPlugin 4.x. No longer maintained; does not support Webpack 5. Differentiates from other inlining solutions by specifically targeting CSS extraction patterns.

npm install style-ext-html-webpack-plugin
INSTALL
IMPORT
SIG · STYLE-EXT-HTML-WEB
S
style-ext-html-webpack-plugin
devopsjavascriptv4.1.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

styleExtHtmlWebpackPlugin
const StyleExtHtmlWebpackPlugin = require('style-ext-html-webpack-plugin');
import StyleExtHtmlWebpackPlugin from 'style-ext-html-webpack-plugin';
This package exports a CommonJS module; ESM import will fail. Use require().
constructor
new StyleExtHtmlWebpackPlugin({ ...options })
new styleExtHtmlWebpackPlugin({ ...options })
Constructor name is PascalCase; the imported function is the constructor itself.
plugin configuration
plugins: [new StyleExtHtmlWebpackPlugin()]
plugins: [require('style-ext-html-webpack-plugin')]
Must instantiate the plugin with 'new'; passing the function reference does not work.

Minimal webpack configuration with HtmlWebpackPlugin, MiniCssExtractPlugin, and StyleExtHtmlWebpackPlugin to inline CSS as <style> tags.

const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const StyleExtHtmlWebpackPlugin = require('style-ext-html-webpack-plugin'); module.exports = { module: { rules: [{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] }] }, plugins: [ new HtmlWebpackPlugin(), new MiniCssExtractPlugin(), new StyleExtHtmlWebpackPlugin() ] };
Debug
Known issues
deprecatedProject is no longer maintained. Does not support Webpack 5. Final version is 4.1.3.
fix
Consider forking or migrating to alternative solutions like html-webpack-inline-style-plugin or custom HtmlWebpackPlugin hooks.
affects: >=4.1.3
breakingv4.x requires Node 6 or higher, Webpack 4.x, and HtmlWebpackPlugin 4.x.
fix
Upgrade to Webpack 4 and HtmlWebpackPlugin 4 if on v3; or downgrade to v3.x of style-ext-html-webpack-plugin for older setups.
affects: >=4.0.0 <5.0.0
gotchaCSS files using MiniCssExtractPlugin are inlined as <style> tags even if you wanted external links.
fix
Do not use this plugin if you want external CSS files; only use for inline styles.
affects: >=4.0.0
gotchaThe plugin may not work with multiple entry points or Hot Module Replacement when using MiniCssExtractPlugin.
fix
Test your setup thoroughly; consider using ExtractTextPlugin instead if HMR is required.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'style-ext-html-webpack-plugin'
Package not installed or installed globally without local install.
fix
Run 'npm install style-ext-html-webpack-plugin --save-dev' in your project directory.
TypeError: StyleExtHtmlWebpackPlugin is not a constructor
Using import instead of require or forgetting 'new' keyword.
fix
Use 'const StyleExtHtmlWebpackPlugin = require('style-ext-html-webpack-plugin');' and instantiate with 'new'.
Error: HookWebpackError: Plugin could not be instantiated
Incompatible version of Webpack or HtmlWebpackPlugin.
fix
Ensure you have Webpack 4.x and HtmlWebpackPlugin 4.x installed; check peer dependencies.
Upgrade
Version history
4.1.3latest on npm
Audit
Dependencies
html-webpack-pluginrequiredpeer dependency for generating HTML with styles
webpackrequiredpeer dependency, version 4.x required
mini-css-extract-pluginoptionalused to generate CSS assets that are then inlined
extract-text-webpack-pluginoptionalalternative to mini-css-extract-plugin for older setups
Agent activity
7 hits · last 30 days
node
6
Resources
style-ext-html-webpack-plugin — npm install style-ext-html-webpack-plugin · libregistry