Socket
Book a DemoInstallSign in
Socket

blurhash-loader

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blurhash-loader

A blurhash loader module for webpack.

0.6.0
latest
Source
npmnpm
Version published
Weekly downloads
23
1050%
Maintainers
2
Weekly downloads
 
Created
Source

blurhash-loader

A blurhash loader module for webpack.

Install

$ npm install -D blurhash-loader

or

$ yarn add -D blurhash-loader

Usage

webpack.config.js

module.exports = {
  module: {
    rules: [
      test: /\.(?:gif|jpe?g|png|webp)$/i,
      use: [
        {
          loader: 'blurhash-loader',
          options: {
            componentX: 4,
            componentY: 3
          }
        }
      ]
    ]
  }
}

index.tsx

import { Blurhash } from 'react-blurhash'
import photo, { blurhash } from './photo.jpg'

export default function Home() {
  return (
    <div>
      <Blurhash hash={blurhash} height={600} width={800} />
    </div>
  )
}

Options

NameTypeDefaultDescription
componentX{Number}4A componentX is the value passed directly to blurhash.
componentY{Number}3A componentY is the value passed directly to blurhash.
context{String}loaderContext.rootContextA custom file context.
emitFile{Boolean}trueDon't emit the file if false is specified.
esModule{Boolean}trueIf enabled, use the ES modules syntax.
name{String|Function}'[contenthash].[ext]'The filename template for the target file.
outputPath{String|Function}undefinedA custom output path for the target file.
publicPath{String|Function}undefinedA custom public path for the target file.

License

MIT

Keywords

webpack

FAQs

Package last updated on 22 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.