react-image-size-loader

1.0.0 • Public • Published

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" />

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    12
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    12

Package Sidebar

Install

npm i react-image-size-loader

Weekly Downloads

5

Version

1.0.0

License

MIT

Last publish

Collaborators

  • andreypopp