postcss-image-inliner
Advanced tools
Comparing version 0.3.0 to 0.3.1
v0.3.1 / 2016-05-10 | ||
=================== | ||
* travis tweaks | ||
* bump deps & eslint-config | ||
* added glob tests | ||
v0.3.0 / 2016-02-05 | ||
=================== | ||
* handle content property (#61) | ||
* bump deps | ||
0.2.0 / 2015-12-10 | ||
@@ -3,0 +16,0 @@ ================== |
10
index.js
@@ -14,8 +14,7 @@ var postcss = require('postcss'); | ||
module.exports = postcss.plugin('postcss-image-inliner', function (opts) { | ||
opts = defaults(opts || {}, { | ||
assetPaths: [], | ||
assetPaths: [], | ||
maxFileSize: 10240, | ||
b64Svg: false, | ||
strict: false | ||
b64Svg: false, | ||
strict: false | ||
}); | ||
@@ -29,3 +28,2 @@ | ||
function assertSize(resource) { | ||
@@ -45,3 +43,3 @@ var encoding = resource.mime === 'image/svg+xml' ? 'utf-8' : 'binary'; | ||
return getResource(filepath, { | ||
base: opts.assetPaths, | ||
base: opts.assetPaths, | ||
filter: assertSize | ||
@@ -48,0 +46,0 @@ }).catch(function (err) { |
@@ -15,3 +15,3 @@ var debug = require('debug')('image-inliner'); | ||
// strip comments | ||
.replace(/<\!\-\-(.*(?=\-\->))\-\->/gmi, '') | ||
.replace(/<!\-\-(.*(?=\-\->))\-\->/gmi, '') | ||
// replace | ||
@@ -39,3 +39,3 @@ .replace(/'/gmi, '\\i')) | ||
data: 'data:image/svg+xml;charset=US-ASCII,' + encodeSvg(file), | ||
key: key | ||
key: key | ||
}); | ||
@@ -49,3 +49,3 @@ }); | ||
data: 'data:' + file.mime + ';base64,' + new Buffer(file.contents, 'binary').toString('base64'), | ||
key: key | ||
key: key | ||
}; | ||
@@ -55,3 +55,2 @@ }; | ||
function getDataUri(res, opts) { | ||
@@ -64,6 +63,4 @@ var promises = map(res, computeDataUri(opts)); | ||
}, {}); | ||
} | ||
module.exports.getDataUri = getDataUri; |
{ | ||
"name": "postcss-image-inliner", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "PostCSS plugin to inline images into css", | ||
@@ -24,6 +24,6 @@ "keywords": [ | ||
"dependencies": { | ||
"asset-resolver": "0.1.1", | ||
"bluebird": "3.2.1", | ||
"asset-resolver": "0.2.1", | ||
"bluebird": "3.3.5", | ||
"debug": "2.2.0", | ||
"filesize": "3.2.1", | ||
"filesize": "3.3.0", | ||
"lodash.defaults": "^4.0.0", | ||
@@ -40,12 +40,13 @@ "lodash.escaperegexp": "^4.0.0", | ||
"object-hash": "^1.1.0", | ||
"postcss": "5.0.14", | ||
"request": "2.67.0", | ||
"svgo": "0.6.1", | ||
"postcss": "5.0.21", | ||
"request": "2.72.0", | ||
"svgo": "0.6.6", | ||
"then-fs": "2.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "3.4.1", | ||
"chai": "3.5.0", | ||
"eslint-config-xo": "^0.14.1", | ||
"finalhandler": "0.4.1", | ||
"gulp": "3.9.0", | ||
"gulp-eslint": "1.1.1", | ||
"gulp": "3.9.1", | ||
"gulp-eslint": "2.0.0", | ||
"gulp-mocha": "2.2.0", | ||
@@ -52,0 +53,0 @@ "serve-static": "1.10.2" |
@@ -42,7 +42,7 @@ # PostCSS Image Inliner [![Build Status][ci-img]][ci] | ||
Default: `[process.cwd()]` | ||
Example: `['http://domain.de/', 'http://domain.de/styles', 'app/images']` | ||
Example: `['http://domain.de/', 'http://domain.de/styles', 'app/images', '**/images/']` | ||
Required: `false` | ||
List of directories/urls where the inliner should start looking for assets. | ||
You can define local directories or URLs. | ||
You can define local directories (globs supported) or URLs. | ||
@@ -49,0 +49,0 @@ |
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
9883
7
+ Addedarray-union@1.0.2(transitive)
+ Addedarray-uniq@1.0.3(transitive)
+ Addedarrify@1.0.1(transitive)
+ Addedasset-resolver@0.2.1(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbl@1.1.2(transitive)
+ Addedbluebird@3.3.5(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedcsso@2.0.0(transitive)
+ Addedfilesize@3.3.0(transitive)
+ Addedglob@6.0.4(transitive)
+ Addedglobby@4.1.0(transitive)
+ Addedhash@0.2.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedjs-yaml@3.6.1(transitive)
+ Addedlodash@4.12.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpostcss@5.0.21(transitive)
+ Addedqs@6.1.2(transitive)
+ Addedrequest@2.71.02.72.0(transitive)
+ Addedsax@1.2.4(transitive)
+ Addedsvgo@0.6.6(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedasset-resolver@0.1.1(transitive)
- Removedbl@1.0.3(transitive)
- Removedbluebird@2.11.03.2.1(transitive)
- Removedcsso@1.4.4(transitive)
- Removedfilesize@3.2.1(transitive)
- Removedhash@0.2.1(transitive)
- Removedinherit@2.2.7(transitive)
- Removedjs-yaml@3.4.6(transitive)
- Removedlodash._arraycopy@3.0.0(transitive)
- Removedlodash._arrayeach@3.0.0(transitive)
- Removedlodash._arraymap@3.0.0(transitive)
- Removedlodash._baseassign@3.2.0(transitive)
- Removedlodash._basecallback@3.3.1(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._baseeach@3.0.4(transitive)
- Removedlodash._baseget@3.7.2(transitive)
- Removedlodash._baseisequal@3.0.7(transitive)
- Removedlodash._baseslice@3.0.3(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._bindcallback@3.0.1(transitive)
- Removedlodash._createassigner@3.1.1(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._topath@3.8.1(transitive)
- Removedlodash.assign@3.2.0(transitive)
- Removedlodash.defaults@3.1.2(transitive)
- Removedlodash.foreach@3.0.3(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.isfunction@3.0.9(transitive)
- Removedlodash.istypedarray@3.0.6(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.map@3.1.4(transitive)
- Removedlodash.pairs@3.0.1(transitive)
- Removedlodash.pluck@3.1.2(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.result@3.1.2(transitive)
- Removedlodash.toarray@3.0.2(transitive)
- Removedpostcss@5.0.14(transitive)
- Removedqs@5.2.1(transitive)
- Removedrequest@2.67.0(transitive)
- Removedsax@1.1.6(transitive)
- Removedsvgo@0.6.1(transitive)
Updatedasset-resolver@0.2.1
Updatedbluebird@3.3.5
Updatedfilesize@3.3.0
Updatedpostcss@5.0.21
Updatedrequest@2.72.0
Updatedsvgo@0.6.6