|
19 | 19 | var run = require('run-sequence'); |
20 | 20 |
|
21 | 21 | module.exports = function(gulp, plugins, C) { |
22 | | - var IS_DEBUG = !!plugins.gutil.env.debug; |
23 | | - |
24 | | - function dbg(t) { |
25 | | - return plugins.gif(IS_DEBUG, plugins.debug({title:t})); |
26 | | - } |
27 | 22 |
|
28 | 23 | gulp.task('patch-lib', function() { |
29 | 24 |
|
30 | 25 | gulp.src(C.PATCH_LIST, {base: C.BOWER}) |
31 | | - .pipe(dbg('patch-lib')) |
| 26 | + .pipe(C.dbg('patch-lib')) |
32 | 27 | .pipe(plugins.wrap(function(data) { |
33 | 28 | if (data.file.contents.toString('utf8').indexOf('/*patched*/') !== -1) { |
34 | 29 | return "{{{contents}}}"; |
|
46 | 41 | gulp.task('copy', function() { |
47 | 42 | return gulp.src([j(C.SRC,'**/*.+(html|js|woff)'), j('!',C.SRC,'**/example.html')]) |
48 | 43 | .pipe(plugins.cache('copy')) |
49 | | - .pipe(dbg('copy')) |
| 44 | + .pipe(C.dbg('copy')) |
50 | 45 | .pipe(gulp.dest(C.BUILD)); |
51 | 46 | }); |
52 | 47 |
|
|
56 | 51 | .pipe(plugins.cache('scss')) |
57 | 52 | .pipe(plugins.sass({includePaths: C.SASS_INCLUDE}).on('error', plugins.sass.logError)) |
58 | 53 | .pipe(plugins.postcss([autoprefixer({browsers: ['last 2 versions']})])) |
59 | | - .pipe(dbg('sass')) |
| 54 | + .pipe(C.dbg('sass')) |
60 | 55 | .pipe(gulp.dest(C.BUILD)) |
61 | 56 | .pipe(plugins.wrap(function(data) { |
62 | 57 | data.fname = path.basename(data.file.relative,'.css'); |
63 | 58 | return wrapper; |
64 | 59 | },{},{engine:"hogan"})) |
65 | 60 | .pipe(plugins.rename({basename:"style", extname: ".html"})) |
66 | | - .pipe(dbg('sass-html')) |
| 61 | + .pipe(C.dbg('sass-html')) |
67 | 62 | .pipe(gulp.dest(C.BUILD)); |
68 | 63 | }); |
69 | 64 |
|
70 | 65 | gulp.task('font', function() { |
71 | 66 | return gulp.src(j(C.SRC, C.SHARED, '/fonts/fonts.scss')) |
72 | 67 | .pipe(plugins.sass({includePaths: C.SASS_INCLUDE}).on('error', plugins.sass.logError)) |
73 | | - .pipe(dbg('font')) |
| 68 | + .pipe(C.dbg('font')) |
74 | 69 | .pipe(gulp.dest(C.BUILD + 'shared/fonts/')) |
75 | 70 | .pipe(plugins.wrap("<style>{{{contents}}}</style>",{},{engine:"hogan"}).on('error',console.log)) |
76 | 71 | .pipe(plugins.rename("fonts.html").on('error',console.log)) |
77 | | - .pipe(dbg('font-output')) |
| 72 | + .pipe(C.dbg('font-output')) |
78 | 73 | .pipe(gulp.dest(j(C.BUILD,'/shared/fonts/'))); |
79 | 74 | }); |
80 | 75 |
|
|
121 | 116 | inlineCss: true, |
122 | 117 | implicitStrip: false |
123 | 118 | }, excludes, C.BUILD)) |
124 | | - .pipe(dbg('vulcanize-modules')) |
| 119 | + .pipe(C.dbg('vulcanize-modules')) |
125 | 120 | .pipe(plugins.htmlmin()) |
126 | 121 | .pipe(gulp.dest(C.BUILD)); |
127 | 122 |
|
|
130 | 125 | inlineScripts: true, |
131 | 126 | inlineCss: true |
132 | 127 | })) |
133 | | - .pipe(dbg('vulcanize-lib')) |
| 128 | + .pipe(C.dbg('vulcanize-lib')) |
134 | 129 | .pipe(gulp.dest(C.BUILD)); |
135 | 130 | return merge(modules, lib); |
136 | 131 | }); |
|
148 | 143 | }); |
149 | 144 |
|
150 | 145 | gulp.task('lib-version', function() { |
151 | | - var pkg = getPkgInfo(); |
| 146 | + var pkg = C.getPkgInfo(); |
152 | 147 | var templatePath = j(C.TEMPLATES, '/lib_version.html'); |
153 | 148 | var templateString = fs.readFileSync(templatePath, 'utf8'); |
154 | 149 | var template = hogan.compile(templateString); |
|
174 | 169 | })) |
175 | 170 | .pipe(plugins.inlinemin()) |
176 | 171 | .pipe(plugins.header('<!--\n' + fs.readFileSync('BANNER.txt','utf8') + ' -->')) |
177 | | - .pipe(dbg('vulcanize-modules')) |
| 172 | + .pipe(C.dbg('vulcanize-modules')) |
178 | 173 | .pipe(gulp.dest(C.DIST)); |
179 | 174 |
|
180 | 175 | var lib = gulp.src(j(C.BUILD,'strand.html')) |
|
191 | 186 | })) |
192 | 187 | .pipe(plugins.inlinemin()) |
193 | 188 | .pipe(plugins.header('<!--\n' + fs.readFileSync('BANNER.txt','utf8') + ' -->')) |
194 | | - .pipe(dbg('vulcanize-lib')) |
| 189 | + .pipe(C.dbg('vulcanize-lib')) |
195 | 190 | .pipe(gulp.dest(C.DIST)); |
196 | 191 |
|
197 | 192 | return merge(modules, lib); |
|
0 commit comments