Image dimensions loader for Webpack
A webpack loader which retrieves the dimensions of the image.
This loader does not emit the file itself; it only gives you an object with information about the file. If you also want the file emitted, see the project this was forked from.
Usage
npm install image-dimensions-loader --savevar image = ;// => returns an object// => { width: 150, height: 50, type: "png", bytes: 1234 }
Examples
webpack.config.js
// webpack.config.jsmoduleexports = output: publicPath: '/public/' module: loaders: test: /\.$/ loader: 'image-dimensions' ;
example_module.js
var result = ;// => {width: 500, height: 700, type: "png", bytes: 1234}