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

css-combo

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-combo - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

test/css/external/ext_mod.css

24

lib/index.js

@@ -18,3 +18,8 @@ /**

self.imports = [];
/**
* 额外进行查找的路径,如:paths: 'path/to/app/utils', path/to/app/public/a.js文件内容:@import "mod.css"
* 1、现在当前路径下寻找: path/to/app/public/mod.css
* 2、若找不到,则再查找: path/to/app/utils/mod.css
*/
self.paths = cfg.paths || [];
utils.debug = cfg.debug;

@@ -81,3 +86,16 @@ cfg.target = cfg.src || cfg.target;

}else{
utils.log('cannot find file ' + filePath, 'warning');
// 若在当前文件夹找不到,就去paths中寻找,直到找到为止
self.paths.forEach(function( pathBase ){
if( !content ){
var outFilePath = path.resolve( pathBase, file);
if( fs.existsSync(outFilePath) ){
var buf = fs.readFileSync( outFilePath );
content = iconv.decode(buf, config.inputEncoding ? config.inputEncoding : utils.detectCharset(buf));
}
}
});
if(!content){
utils.log('cannot find file ' + filePath, 'warning');
}
}

@@ -311,3 +329,3 @@ }else{

var funcs = [];
_.forEach(files, function(file, index){

@@ -314,0 +332,0 @@ funcs.push(function(cb){

4

package.json
{
"name":"css-combo",
"version":"0.3.0",
"version":"0.3.1",
"description":"css module combo tool",

@@ -36,3 +36,3 @@ "author":"daxingplay <daxingplay@gmail.com>",

"scripts": {
"test": "mocha"
"test": "mocha -t 20000"
},

@@ -39,0 +39,0 @@ "licenses":[

@@ -50,2 +50,3 @@ # css-combo

* debug: {Boolean} 是否打印日志
* paths: {Array} `@import`额外查找的路径。

@@ -52,0 +53,0 @@ ### 在grunt中使用 ###

@@ -12,2 +12,3 @@ var CssCombo = require('../lib/index'),

debug: false,
paths: [ path.resolve(__dirname, 'css/external' ) ],
inputEncoding: 'gbk',

@@ -28,3 +29,3 @@ outputEncoding: 'gbk',

}
if (report.imports.length !== 7) {
if (report.imports.length !== 8) {
throw new Error('report.imports Error');

@@ -31,0 +32,0 @@ }

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