gulp-combo
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -13,2 +13,7 @@ Gulp Combo Change History | ||
* 默认链接支持http(s)的替换 | ||
* 默认链接支持http(s)的替换 | ||
0.1.12 | ||
------ | ||
* 替换路径支持通过options.replaceDomain配置指定域名的替换,覆盖默认域名(mc.meituan.net) |
18
index.js
@@ -58,3 +58,10 @@ /* jshint node: true */ | ||
if($.match(/\/\//igm)) { | ||
var matchs = $1.match(/^(http(s)?:)?\/\/mc.meituan.net\//igm); | ||
var matchs; | ||
if (options.replaceDomain) { | ||
// replaceDomain为需要被替换的域名,覆盖默认正则 | ||
var reg = new RegExp('^(http(s)?:)?\/\/' + options.replaceDomain + '\/', 'igm'); | ||
matchs = $1.match(reg); | ||
} else { | ||
matchs = $1.match(/^(http(s)?:)?\/\/mc.meituan.net\//igm); | ||
} | ||
if(matchs) { | ||
@@ -83,3 +90,10 @@ src.scripts.push($1.replace(matchs[0], '')); | ||
if($.match(/\/\//igm)) { | ||
var matchs = $1.match(/^(http(s)?:)?\/\/mc.meituan.net\//igm); | ||
var matchs; | ||
if (options.replaceDomain) { | ||
// replaceDomain为需要被替换的域名,覆盖默认正则 | ||
var reg = new RegExp('^(http(s)?:)?\/\/' + options.replaceDomain + '\/', 'igm'); | ||
matchs = $1.match(reg); | ||
} else { | ||
matchs = $1.match(/^(http(s)?:)?\/\/mc.meituan.net\//igm); | ||
} | ||
if(matchs) { | ||
@@ -86,0 +100,0 @@ src.links.push($1.replace(matchs[0], '')); |
{ | ||
"name": "gulp-combo", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "html scripts, links combo for gulp", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
8585
101
1