react-image-size-loader
v1.0.0
Published
Webpack loader for images which generate <img /> React components
Downloads
20
Maintainers
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" />