fis3-deploy-html-inline-merge
Advanced tools
Comparing version 0.0.1 to 0.0.2
17
index.js
'use strict'; | ||
var script = /<script(\s+type=["']text\/javascript["'])?>([\s\S]*?)<\/script>/g, | ||
style = /<style(\s+type=["']text\/css["'])?>([\s\S]*?)<\/style>/g; | ||
module.exports = function(opts, modified, total, next) { | ||
@@ -9,7 +12,6 @@ modified.forEach(function(file) { | ||
content = content.replace(/(<script(\s+type=["']text\/javascript["'])?>([\s\S]*?)<\/script>\s*){2,}/, function(str) { | ||
var single = /<script(\s+type=["']text\/javascript["'])?>([\s\S]*?)<\/script>/g, | ||
code = [], | ||
content = content.replace(new RegExp('(' + script.source + '\s*){2,}', 'g'), function(str) { | ||
var code = [], | ||
match = null; | ||
while (match = single.exec(str)) { | ||
while (match = script.exec(str)) { | ||
code.push(match[2]); | ||
@@ -20,7 +22,6 @@ } | ||
content = content.replace(/(<style(\s+type=["']text\/css["'])?>([\s\S]*?)<\/style>\s*){2,}/, function(str) { | ||
var single = /<style(\s+type=["']text\/css["'])?>([\s\S]*?)<\/style>/g, | ||
code = [], | ||
content = content.replace(new RegExp('(' + style.source + '\s*){2,}', 'g'), function(str) { | ||
var code = [], | ||
match = null; | ||
while (match = single.exec(str)) { | ||
while (match = style.exec(str)) { | ||
code.push(match[2]); | ||
@@ -27,0 +28,0 @@ } |
{ | ||
"name": "fis3-deploy-html-inline-merge", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "fis3 合并html中的style/script inline标签", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
2587