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"
    },
    ...
]

Readme

Keywords

none

Package Sidebar

Install

npm i html-srcset-loader

Weekly Downloads

17

Version

0.1.1

License

none

Last publish

Collaborators

  • icewind1991