- Notifications
You must be signed in to change notification settings - Fork4
Inline css style using webpack HTMLWebpackPlugin
License
djaax/html-webpack-inline-style-plugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This package extends thehtml-webpack-plugin functionality by inlining existing styles to HTML elements usingjuice.
You might want to use this to automate email generation with webpack.
The following input provided by the HTMLWebpackPlugin:
<style>div{color:red;}</style><div/>
will result in
<divstyle="color: red;"></div>
To include your style source/link into your document as shown above, have a look athtml-webpack-inline-source-plugin
You must be running webpack on node 6.4 or higher
Install the plugin with npm:
$ npm install --save-dev html-webpack-inline-style-plugin
Install the plugin with yarn:
$ yarn add --dev html-webpack-inline-style-plugin
Require the plugin in your webpack config:
varHtmlWebpackInlineStylePlugin=require('html-webpack-inline-style-plugin');
Add the plugin to your webpack config as follows:
{...plugins:[newHtmlWebpackPlugin(),newHtmlWebpackInlineStylePlugin()]...}
WithJuice options:
{...plugins:[newHtmlWebpackPlugin(),newHtmlWebpackInlineStylePlugin({juiceOptions:{removeStyleTags:false}})]...}
About
Inline css style using webpack HTMLWebpackPlugin
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.