Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-inline

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-inline - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

0

Gruntfile.js

@@ -0,0 +0,0 @@ 'use strict';

2

package.json

@@ -9,3 +9,3 @@ {

"description": "Inlines img, script and link tags into the same file.",
"version": "0.3.4",
"version": "0.3.5",
"keywords": [

@@ -12,0 +12,0 @@ "gruntplugin",

@@ -16,3 +16,3 @@ /*

var CleanCSS = require('clean-css');
grunt.registerMultiTask('inline', "Replaces <link>, <script> and <img> tags to their inline contents", function() {

@@ -29,7 +29,7 @@

this.files.forEach(function(filePair){
isExpandedPair = filePair.orig.expand || false;
filePair.src.forEach(function(filepath){
var fileType = path.extname(filepath).replace(/^\./, '');

@@ -52,3 +52,3 @@ var fileContent = grunt.file.read(filepath);

}
grunt.file.write(destFilepath, fileContent);

@@ -75,3 +75,3 @@ grunt.log.ok()

}
}
}

@@ -119,6 +119,10 @@ function unixifyPath(filepath) {

if(!_src.match(/^http\:\/\//)){
_ret =arguments[1] + _more + arguments[2] + arguments[3];
if(options.relativeHTMLPath){ // 转换相对路径--add by vienwu
_ret =arguments[1] + path.join(src,'../',arguments[2]).replace(/\\/g,'/') + arguments[3];
}else{
_ret =arguments[1] + _more + arguments[2] + arguments[3];
}
grunt.log.writeln('inline >含有相对目录进行替换操作,替换之后的路径:' + _ret );
}
return _ret;
return _ret;
}

@@ -144,5 +148,5 @@ ret = ret.replace(/(<script.+?src=["'])([^"']+?)(["'].*?><\/script>)/g,_addMore);

}
}
}
grunt.log.debug('ret = : ' + ret +'\n');
return ret;

@@ -152,6 +156,6 @@

var ret = matchedWord;
if(!isRemotePath(src) && src.indexOf(options.tag)!=-1){
var inlineFilePath = path.resolve( path.dirname(filepath), src ).replace(/\?.*$/, ''); // 将参数去掉
var inlineFilePath = path.resolve( path.dirname(filepath), src ).replace(/\?.*$/, ''); // 将参数去掉

@@ -166,10 +170,10 @@ if( grunt.file.exists(inlineFilePath) ){

grunt.log.debug('ret = : ' + ret +'\n');
return ret;
return ret;
}).replace(/<img.+?src=["']([^"':]+?)["'].*?\/?\s*?>/g, function(matchedWord, src){
var ret = matchedWord;
if(!grunt.file.isPathAbsolute(src) && src.indexOf(options.tag)!=-1){
var inlineFilePath = path.resolve( path.dirname(filepath), src ).replace(/\?.*$/, ''); // 将参数去掉
var inlineFilePath = path.resolve( path.dirname(filepath), src ).replace(/\?.*$/, ''); // 将参数去掉

@@ -181,6 +185,6 @@ if( grunt.file.exists(inlineFilePath) ){

}
}
}
grunt.log.debug('ret = : ' + ret +'\n');
return ret;
return ret;
});

@@ -187,0 +191,0 @@

@@ -0,0 +0,0 @@ var grunt = require('grunt');

@@ -0,0 +0,0 @@ var grunt = require('grunt');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc