Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 3c24545

Browse files
fix: fallback loader will be used than limit is equal or greater (#179)
BREAKING CHANGE: fix: fallback loader will be used than limit is equal or greater
1 parent a6705cc commit 3c24545

File tree

4 files changed

+62
-6
lines changed

4 files changed

+62
-6
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,10 @@ For example, to set the quality option of a responsive-loader above use:
9494
Type: `Number`
9595
Default: `undefined`
9696

97-
A `Number` specifying the maximum size of a file in bytes. If the file is
98-
greater than the limit,
99-
[`file-loader`](https://github.com/webpack-contrib/file-loader) is used by
100-
default and all query parameters are passed to it. Using an alternative to
101-
`file-loader` is enabled via the `fallback` option.
97+
A `Number` specifying the maximum size of a file in bytes. If the file size is
98+
**equal** or **greater** than the limit [`file-loader`](https://github.com/webpack-contrib/file-loader)
99+
will be used (by default) and all query parameters are passed to it.
100+
Using an alternative to `file-loader` is enabled via the `fallback` option.
102101

103102
The limit can be specified via loader options and defaults to no limit.
104103

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function loader(src) {
3131
const mimetype = options.mimetype || mime.getType(file);
3232

3333
// No limit or within the specified limit
34-
if (!limit || src.length < limit) {
34+
if (!limit || src.length <= limit) {
3535
if (typeof src === 'string') {
3636
src = Buffer.from(src);
3737
}

0 commit comments

Comments
 (0)