1.0.0 • Published 8 years ago

img-ali-loader v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

img loader for webpack

installation

npm install img-loader --save-dev

Function

soooooooooo easy, just see the example below

before

.test{
  background: url(http://gtms02.alicdn.com/tps/i1/TB1BN4mJFXXXXbVXpXX4XhHIVXX-76-40.png) no-repeat 0 0;
}

after

.test{
  background: url(//img.alicdn.com/tps/i1/TB1BN4mJFXXXXbVXpXX4XhHIVXX-76-40.png_.webp) no-repeat 0 0;
}

Example config

module.exports = {
  module: {
    loaders: [
      {
        test: /\.css$/,
        loader: 'style-loader!css-loader!img-loader'

      }
    ]
  }
};

License

MIT (http://www.opensource.org/licenses/mit-license.php)