html-webpack-css-inliner-plugin

1.0.0 • Public • Published

CSS Inliner Extension for the HTMLWebpackPlugin

This package extends the html-webpack-plugin functionality by inlining existing styles to HTML elements using juice.

You might want to use this to automate email generation with Webpack 5.

The following input provided by the HTMLWebpackPlugin:

<style>span {display: block;}</style>

will result in

<span style="display: block;"></span>

Installation

Install the plugin with npm:

$ npm install --save-dev html-webpack-css-inliner-plugin

Install the plugin with yarn:

$ yarn add --dev html-webpack-css-inliner-plugin

Basic Usage

Require the plugin in your webpack config:

var HtmlWebpackCssInlinerPlugin = require('html-webpack-css-inliner-plugin');

Add the plugin to your webpack config as follows:

{
	...
	plugins: [
	  new HtmlWebpackPlugin(),
	  new HtmlWebpackCssInlinerPlugin()
	]
	...
}

Package Sidebar

Install

npm i html-webpack-css-inliner-plugin

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

3.25 kB

Total Files

4

Last publish

Collaborators

  • euro1985