JSPM

react-image-size-loader

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q34404F
  • License MIT

Webpack loader for images which generate <img /> React components

Package Exports

  • react-image-size-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-image-size-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Image Size Loader

Webpack loader for images which generates React <img /> components with height and width attributes set.

Installation

% npm install react-image-size-loader

Webpack config example:

module.exports = {
  module: {
    loaders: [
      {
        test: /\.(gif|jpeg|jpg|png|svg)$/,
        loader: 'react-image-size-loader'
      }
    ]
  }
}

Code example:

import Logo from './cat.jpg'

React.render(<Logo />) // => <img width="300" height="188" src="cat.jpg" />