Skip to content

Commit e591d0d

Browse files
author
Shuwen Qian
committed
Cleanup, add banner to prod build
1 parent 46a8494 commit e591d0d

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

Gulpfile.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
/*jslint node: true */
3-
3+
/*jslint esversion: 6*/
44
//TODO(shuwen): split into multiple files
55
//TODO(shuwen): replace path string concatenation with path.join
66

@@ -33,6 +33,7 @@ var conventionalChangelog = require('gulp-conventional-changelog');
3333
var ghPages = require('gulp-gh-pages');
3434
var through = require('through2');
3535
var hogan = require('hogan.js');
36+
var header = require('gulp-header');
3637

3738
var SRC = 'src/';
3839
var BUILD = 'build/';
@@ -130,28 +131,19 @@ gulp.task('vulcanize:prod', function() {
130131
spare: true
131132
}))
132133
.pipe(inlinemin())
134+
.pipe(header(`<!--\n${fs.readFileSync('BANNER.txt').toString('utf8')}\n-->`))
133135
.pipe(gulp.dest(BUILD));
134136
});
135137

136138
gulp.task('copy:prod', ['vulcanize:prod'], function() {
137-
return gulp.src([BUILD+'**/*.+(html|woff)', '!'+BUILD+'/shared/**/*.html', '!'+BUILD +'**/example.html'])
139+
return gulp.src([
140+
path.join(BUILD, 'strand.html'),
141+
path.join(BUILD, '**/*.woff')
142+
])
138143
.pipe(changed(DIST))
139-
.pipe(debug())
140144
.pipe(gulp.dest(DIST));
141145
});
142146

143-
// gulp.task('minify:prod', function() {
144-
// return gulp.src(BUILD+'strand.html')
145-
// .pipe(debug())
146-
// .pipe(htmlmin({
147-
// quotes: true,
148-
// empty: true,
149-
// spare: true
150-
// }))
151-
// .pipe(inlinemin())
152-
// .pipe(gulp.dest(DIST))
153-
// });
154-
155147
/** DOCS **/
156148
gulp.task('docs', ['copy:docs', 'sass:docs', 'docs:templates']);
157149

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"gulp-debug": "^2.1.2",
2727
"gulp-gh-pages": "^0.5.4",
2828
"gulp-git": "^1.7.0",
29+
"gulp-header": "^1.7.1",
2930
"gulp-inline-assets": "^0.1.1",
3031
"gulp-marked": "^1.0.0",
3132
"gulp-minify-html": "^1.0.5",

0 commit comments

Comments
 (0)