Skip to content

Commit

Permalink
fix: 修复引用向相同文件相互覆盖的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
daijinma committed Nov 4, 2018
1 parent 1829d77 commit e5ac7b8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "publish-helper",
"version": "1.2.0",
"version": "1.2.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
13 changes: 12 additions & 1 deletion src/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,19 @@ function selector(done){
if(self.mapfile.static.length==0){
return resolve();
}
var tempArr = [];

tempArr = self.mapfile.static.sort(function(a,b){
if(a.length < b.length){
return 1;
}else{
return -1;
}
})

console.log(tempArr)

self.mapfile.static.forEach((item, index)=>{
tempArr.forEach((item, index)=>{
let tempUrl = self.mapfile._[item].url;
upload(tempUrl, item, self, (err, data)=>{
self.mapfile.staticCount--;
Expand Down
6 changes: 3 additions & 3 deletions test/go.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ var stripJsonComments = require('strip-json-comments');


new publisher({
src:path.resolve(__dirname, './demo1/*.html'),
dist: path.resolve(__dirname, './demo1/build'),
src:path.resolve(__dirname, '../../active-maker/dist/*.html'),
dist: path.resolve(__dirname, '../../active-maker/output'),
iwantcdn:false,
uploadUrl: "XXXX",// 上传文件 ajax 路径,必填
hostname:function(type, data){
return 'http://cdn.inyuapp.com/';
return 'http://cdn.inyuapp.com';
},
sourceMappingURL:false,
chunk: false,
Expand Down

0 comments on commit e5ac7b8

Please sign in to comment.