Authored by ccbikai(👎🏻🍜)

雪碧图优化

Showing 33 changed files with 15 additions and 12 deletions
@@ -16,15 +16,15 @@ module.exports = { @@ -16,15 +16,15 @@ module.exports = {
16 siteUrl: '//m.yohobuy.com', 16 siteUrl: '//m.yohobuy.com',
17 assetUrl: '//localhost:5001', 17 assetUrl: '//localhost:5001',
18 domains: { 18 domains: {
19 - // api: 'http://api.yoho.cn/',  
20 - // service: 'http://service.yoho.cn/',  
21 - // liveApi: 'http://api.live.yoho.cn/',  
22 - // singleApi: 'http://single.yoho.cn/' 19 + api: 'http://api.yoho.cn/',
  20 + service: 'http://service.yoho.cn/',
  21 + liveApi: 'http://api.live.yoho.cn/',
  22 + singleApi: 'http://single.yoho.cn/'
23 23
24 - api: 'http://api-test1.yohops.com:9999/',  
25 - service: 'http://service-test1.yohops.com:9999/',  
26 - liveApi: 'http://testapi.live.yohops.com:9999/',  
27 - singleApi: 'http://api-test1.yohops.com:9999/' 24 + // api: 'http://api-test1.yohops.com:9999/',
  25 + // service: 'http://service-test1.yohops.com:9999/',
  26 + // liveApi: 'http://testapi.live.yohops.com:9999/',
  27 + // singleApi: 'http://api-test1.yohops.com:9999/'
28 }, 28 },
29 subDomains: { 29 subDomains: {
30 host: '.m.yohobuy.com', 30 host: '.m.yohobuy.com',
@@ -74,4 +74,4 @@ module.exports = () => { @@ -74,4 +74,4 @@ module.exports = () => {
74 } 74 }
75 next(); 75 next();
76 }; 76 };
77 -};  
  77 +};
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 */ 5 */
6 6
7 'use strict'; 7 'use strict';
8 - 8 +const path = require('path');
9 const gulp = require('gulp'); 9 const gulp = require('gulp');
10 const gutil = require('gulp-util'); 10 const gutil = require('gulp-util');
11 const ftp = require('gulp-ftp'); 11 const ftp = require('gulp-ftp');
@@ -57,12 +57,15 @@ const postcssPlugin = (et) => { @@ -57,12 +57,15 @@ const postcssPlugin = (et) => {
57 }, 57 },
58 groupBy(file) { 58 groupBy(file) {
59 var group = file.url.split('/')[1]; 59 var group = file.url.split('/')[1];
60 -  
61 - group = group === '' ? 'yo' : group; 60 + var entry = path.basename(file.styleFilePath, '.css');
62 61
63 file.retina = true; 62 file.retina = true;
64 file.radio = 2; 63 file.radio = 2;
65 64
  65 + if (group) {
  66 + group = entry + '.' + group;
  67 + }
  68 +
66 return group ? Promise.resolve(group) : Promise.reject(group); 69 return group ? Promise.resolve(group) : Promise.reject(group);
67 } 70 }
68 }, 71 },