url-loader
Advanced tools
Comparing version 0.5.7 to 0.5.8
@@ -9,3 +9,3 @@ /* | ||
this.cacheable && this.cacheable(); | ||
var query = loaderUtils.parseQuery(this.query); | ||
var query = loaderUtils.getOptions(this) || {}; | ||
var limit = (this.options && this.options.url && this.options.url.dataUrlLimit) || 0; | ||
@@ -12,0 +12,0 @@ if(query.limit) { |
{ | ||
"name": "url-loader", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"author": "Tobias Koppers @sokra", | ||
"description": "url loader module for webpack", | ||
"dependencies": { | ||
"loader-utils": "0.2.x", | ||
"mime": "1.2.x" | ||
"loader-utils": "^1.0.2", | ||
"mime": "1.3.x" | ||
}, | ||
@@ -10,0 +10,0 @@ "peerDependencies": { |
@@ -1,21 +0,40 @@ | ||
# url loader for webpack | ||
[![npm][npm]][npm-url] | ||
[![node][node]][node-url] | ||
[![deps][deps]][deps-url] | ||
[![tests][tests]][tests-url] | ||
[![coverage][cover]][cover-url] | ||
[![chat][chat]][chat-url] | ||
## Usage | ||
<div align="center"> | ||
<a href="https://github.com/webpack/webpack"> | ||
<img width="200" height="200" | ||
src="https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon.svg"> | ||
</a> | ||
<h1>Url Loader</h1> | ||
</div> | ||
<h2 align="center">Install</h2> | ||
```bash | ||
npm install --save-dev url-loader | ||
``` | ||
<h2 align="center">Usage</h2> | ||
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html) | ||
The `url` loader works like the `file` loader, but can return a Data Url if the file is smaller than a limit. | ||
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 the [`file-loader`](https://github.com/webpack/file-loader) is used and all query parameters are passed to it. | ||
If the file is greater than the limit (in bytes) the [`file-loader`](https://github.com/webpack/file-loader) is used and all query parameters are passed to it. | ||
``` javascript | ||
require("url?limit=10000!./file.png"); | ||
// => DataUrl if "file.png" is smaller that 10kb | ||
require("url-loader?limit=10000!./file.png"); | ||
// => DataUrl if "file.png" is smaller than 10kb | ||
require("url?mimetype=image/png!./file.png"); | ||
require("url-loader?mimetype=image/png!./file.png"); | ||
// => Specify mimetype for the file (Otherwise it's inferred from extension.) | ||
require("url?prefix=img/!./file.png"); | ||
require("url-loader?prefix=img/!./file.png"); | ||
// => Parameters for the file-loader are valid too | ||
@@ -25,4 +44,56 @@ // They are passed to the file-loader if used. | ||
## License | ||
<h2 align="center">Contributing</h2> | ||
MIT (http://www.opensource.org/licenses/mit-license.php) | ||
Don't hesitate to create a pull request. Every contribution is appreciated. In development you can start the tests by calling `npm test`. | ||
<h2 align="center">Maintainers</h2> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars3.githubusercontent.com/u/166921?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/bebraw">Juho Vepsäläinen</a> | ||
</td> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/d3viant0ne">Joshua Wiens</a> | ||
</td> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars3.githubusercontent.com/u/533616?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/SpaceK33z">Kees Kluskens</a> | ||
</td> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://avatars3.githubusercontent.com/u/3408176?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/TheLarkInn">Sean Larkin</a> | ||
</td> | ||
</tr> | ||
<tbody> | ||
</table> | ||
[npm]: https://img.shields.io/npm/v/url-loader.svg | ||
[npm-url]: https://npmjs.com/package/url-loader | ||
[node]: https://img.shields.io/node/v/url-loader.svg | ||
[node-url]: https://nodejs.org | ||
[deps]: https://david-dm.org/webpack/url-loader.svg | ||
[deps-url]: https://david-dm.org/webpack/url-loader | ||
[tests]: http://img.shields.io/travis/webpack/url-loader.svg | ||
[tests-url]: https://travis-ci.org/webpack/url-loader | ||
[cover]: https://coveralls.io/repos/github/webpack/url-loader/badge.svg | ||
[cover-url]: https://coveralls.io/github/webpack/url-loader | ||
[chat]: https://badges.gitter.im/webpack/webpack.svg | ||
[chat-url]: https://gitter.im/webpack/webpack |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6971
7
99
1
+ Addedjson5@1.0.2(transitive)
+ Addedloader-utils@1.4.2(transitive)
+ Addedmime@1.3.6(transitive)
+ Addedminimist@1.2.8(transitive)
- Removedbig.js@3.2.0(transitive)
- Removedemojis-list@2.1.0(transitive)
- Removedjson5@0.5.1(transitive)
- Removedloader-utils@0.2.17(transitive)
- Removedmime@1.2.11(transitive)
- Removedobject-assign@4.1.1(transitive)
Updatedloader-utils@^1.0.2
Updatedmime@1.3.x