JSPM

  • Created
  • Published
  • Downloads 5085595
  • Score
    100M100P100Q197291F
  • License MIT

url loader module for webpack

Package Exports

  • url-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 (url-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm node deps tests coverage chat

Url Loader

Install

npm install --save-dev url-loader

Usage

Documentation: Using loaders

The url loader works like the file loader, but can return a Data Url if the file is smaller than a byte limit.

The limit can be specified with a query parameter. (Defaults to no limit)

If the file is greater than the limit (in bytes) the file-loader is used and all query parameters are passed to it.

require("url-loader?limit=10000!./file.png");
// => DataUrl if "file.png" is smaller than 10kb

require("url-loader?mimetype=image/png!./file.png");
// => Specify mimetype for the file (Otherwise it's inferred from extension.)

require("url-loader?prefix=img/!./file.png");
// => Parameters for the file-loader are valid too
//    They are passed to the file-loader if used.

Contributing

Don't hesitate to create a pull request. Every contribution is appreciated. In development you can start the tests by calling npm test.

Maintainers


Juho Vepsäläinen

Joshua Wiens

Kees Kluskens

Sean Larkin