Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Inline css style using webpack HTMLWebpackPlugin

License

NotificationsYou must be signed in to change notification settings

djaax/html-webpack-inline-style-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

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

Installation

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

Basic Usage

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp