From 5b041ac2ffef403c01d4a415e2b389444c44a7a5 Mon Sep 17 00:00:00 2001 From: carvinlo Date: Sat, 22 Jul 2017 13:55:06 +0800 Subject: [PATCH] skip base64 --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e2dee22..b4860f6 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,7 @@ module.exports = function() { resourcePath, destDir; - if (isAbsoluteUrl(url) || isRootRelativeUrl(url)) { + if (isAbsoluteUrl(url) || isRootRelativeUrl(url) || isBase64Url(url)) { return url; } @@ -62,3 +62,8 @@ function isAbsoluteUrl(url) { function isRootRelativeUrl(url) { return url.charAt(0) === '/'; } + +//skip base64 +function isBase64Url(url) { + return (/^data:image\//).test(url); +}