html-srcset-loader

0.1.1 • Public • Published

html-srcset-loader

Automatically add srcset to images in html

installation

Requires image-resize-loader to create the resized images.

npm install --save-dev loader-utils jimp image-resize-loader html-srcset-loader

Usage

The html-srcset-loader will automatically transform any image in an html document to include an srcset with smaller versions of the image to lower bandwith usage on lower resulution screens.

loaders: [
    {
        test: /.*\.(png|jpg)(\?.+)?$/i,
        loaders: [
            'file',
            'image-resize'
        ]
    },
    {
        test: /\.html$/,
        loader: "html!html-srcset"
    },
    ...
]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    144
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    144
  • 0.1.0
    1

Package Sidebar

Install

npm i html-srcset-loader

Weekly Downloads

145

Version

0.1.1

License

none

Last publish

Collaborators

  • icewind1991