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

fis-auto-packager

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fis-auto-packager - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

5

fis-auto-packager.js

@@ -25,2 +25,3 @@

* {"common_asnyc_js" : [pkg1,pkg2]}
* todo : 添加 **.js
*/

@@ -105,3 +106,3 @@ function createPackConf(resources, sourceDir, outputDir, moduels, projectName){

}
for(var k=0; j<asyncStatics.length; k++){
for(var k=0; k<asyncStatics.length; k++){
var resource = resources[asyncStatics[k]];

@@ -114,2 +115,4 @@ if(resource){

}
//统计静态资源的pv
packageReport.printStaticPv(resources, outputDir, projectName);
var staticUrlMapFile = packageReport.createStaticUrlMap(resources, records, outputDir, projectName);

@@ -116,0 +119,0 @@ //资源过滤需要在打包阶段来做,getResource阶段需要拿到完整的列表分析文件间的依赖关系

@@ -92,2 +92,37 @@ //todo : 是否需要产出收益分析文档报表

/**
* 打印出静态资源的使用次数
* @param resources
*/
module.exports.printStaticPv = function(resources, outputDir, projectName){
var statics = {},
file = outputDir + "/" + projectName + "/" + projectName + "_staticPv.txt",
staticPvStr = "";
util.map(resources, function(id, resource){
var type = resource.get("type");
if(type == "css" || type == "js"){
if(!statics[resource.get("module")]){
statics[resource.get("module")] = [];
}
statics[resource.get("module")].push({
"id" : id,
"pv" : resource.get("pv")
});
}
});
util.map(statics, function(module, moduleStatics){
moduleStatics.sort(function(a, b){
return b.pv - a.pv;
});
});
util.map(statics, function(module, moduleStatics){
staticPvStr += "模块 " + module + "\n";
util.map(moduleStatics, function(index, resource){
staticPvStr += "\t" + resource.id + " : " + resource.pv + "\n";
});
});
util.write(file, staticPvStr);
}
/**
* 产出预测打包后的结果报表

@@ -94,0 +129,0 @@ * @param records : record对象的数组

2

package.json
{
"name": "fis-auto-packager",
"version": "0.0.9",
"version": "0.0.10",
"description": "fis-auto-packager",

@@ -5,0 +5,0 @@ "main": "fis-auto-packager.js",

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