responsive-loader
Advanced tools
Comparing version 1.0.0-rc.2 to 1.0.0
@@ -51,2 +51,3 @@ # Change Log | ||
- Changed default JPEG `quality` to `85` | ||
- The `pass` option is now called `disable` | ||
@@ -53,0 +54,0 @@ ## v0.7.0 |
@@ -61,8 +61,11 @@ 'use strict'; | ||
if (config.pass) { | ||
if (config.disable) { | ||
// emit original content only | ||
var f = loaderUtils.interpolateName(loaderContext, name, { context: outputContext, content: content }); | ||
var f = loaderUtils.interpolateName(loaderContext, name, { | ||
context: outputContext, | ||
content: content | ||
}).replace(/\[width\]/ig, '100').replace(/\[height\]/ig, '100'); | ||
loaderContext.emitFile(f, content); | ||
var p = '__webpack_public_path__ + ' + JSON.stringify(f); | ||
return loaderCallback(null, 'module.exports = {srcSet:' + p + ',images:[{path:' + p + ',width:1}],src: ' + p + ',toString:function(){return ' + p + '}};'); | ||
return loaderCallback(null, 'module.exports = {srcSet:' + p + ',images:[{path:' + p + ',width:100,height:100}],src: ' + p + ',toString:function(){return ' + p + '}};'); | ||
} | ||
@@ -69,0 +72,0 @@ |
{ | ||
"name": "responsive-loader", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0", | ||
"description": "A webpack loader for responsive images", | ||
@@ -53,8 +53,5 @@ "main": "lib/index.js", | ||
"jimp": "^0.2.21", | ||
"sharp": "^0.18.1", | ||
"webpack": "^3.0.0" | ||
"sharp": "^0.18.2", | ||
"webpack": "^3.1.0" | ||
}, | ||
"peerDependencies": { | ||
"jimp": "^0.2.21" | ||
}, | ||
"jest": { | ||
@@ -61,0 +58,0 @@ "testEnvironment": "node" |
@@ -9,2 +9,4 @@ # responsive-loader | ||
> Note: starting with v1.0.0, responsive-loader is only compatible with webpack 2+. For webpack 1 support, use responsive-loader@0.7.0 | ||
### With jimp | ||
@@ -117,5 +119,6 @@ | ||
- `format: string` — either `png` or `jpg`; use to convert to another format; default format is inferred from the source file's extension | ||
- `placeholder: bool` — A true or false value to specify wether to output a placeholder image as a data URI; defaults to `false` | ||
- `placeholder: boolean` — A true or false value to specify wether to output a placeholder image as a data URI; defaults to `false` | ||
- `placeholderSize: integer` — A number value specifying the width of the placeholder image, if enabled with the option above; defaults to `40` | ||
- `adapter: Adapter` — Specify which adapter to use. Can only be specified in the loader options. | ||
- `disable: boolean` — Disable processing of images by this loader (useful in development). `srcSet` and other attributes will still be generated but only for the original size. Note that the `width` and `height` attributes will both be set to `100` but the image will retain its original dimensions. | ||
@@ -122,0 +125,0 @@ #### Adapter-specific options |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
20961
1
199
0
191