Skip to content

lovetingyuan/html-webpack-inline-size-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-webpack-inline-size-plugin

💝 Embed javascript and css source with size limit inside of html when using webpack

travis-ci Version Dependencies License

webpack-logo

install

npm install html-webpack-inline-size-plugin --save-dev

or

yarn add html-webpack-inline-size-plugin -D

usage

  1. specify inlineSize option in html-webpack-plugin
  2. use html-webpack-inline-size-plugin

the option inlineSource used by html-webpack-inline-source-plugin is also supported

example

webpack.config.js

const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackInlineSizePlugin = require('html-webpack-inline-size-plugin');

const webpackConfig = {
  // ... 
  plugins: [
     new HtmlWebpackPlugin({
      inject: true,
      template: 'index.html',
      // other config options
      inlineSize: 5 * 1024 // files that size is smaller than 5kb will be inline in html
    }),
    new HtmlWebpackInlineSizePlugin()
  ]
}

license

MIT

About

Embed javascript and css source inline into html by setting smallest size when using webpack

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published