Move client build output to bin/assets

This commit is contained in:
khlieng 2015-03-04 18:49:31 +01:00
parent fca0f6887e
commit 8a75cdec32
2 changed files with 10 additions and 10 deletions

View File

@ -23,14 +23,14 @@ if (argv.production) {
gulp.task('html', function() { gulp.task('html', function() {
gulp.src('./src/*.html') gulp.src('./src/*.html')
.pipe(minifyHTML()) .pipe(minifyHTML())
.pipe(gulp.dest('./dist')); .pipe(gulp.dest('../bin/assets'));
}); });
gulp.task('css', function() { gulp.task('css', function() {
gulp.src('./src/css/*.css') gulp.src('./src/css/*.css')
.pipe(autoprefixer()) .pipe(autoprefixer())
.pipe(minifyCSS()) .pipe(minifyCSS())
.pipe(gulp.dest('./dist/css')); .pipe(gulp.dest('../bin/assets/css'));
}); });
gulp.task('js', function() { gulp.task('js', function() {
@ -60,7 +60,7 @@ function js(watch) {
return stream return stream
.pipe(source('bundle.js')) .pipe(source('bundle.js'))
.pipe(gulpif(argv.production, streamify(uglify()))) .pipe(gulpif(argv.production, streamify(uglify())))
.pipe(gulp.dest('./dist')); .pipe(gulp.dest('../bin/assets'));
}; };
bundler.on('time', function(time) { bundler.on('time', function(time) {
@ -72,23 +72,23 @@ function js(watch) {
gulp.task('fonts', function() { gulp.task('fonts', function() {
gulp.src('./src/font/*') gulp.src('./src/font/*')
.pipe(gulp.dest('./dist/font')); .pipe(gulp.dest('../bin/assets/font'));
}); });
gulp.task('gzip', ['html', 'css', 'js', 'fonts'], function() { gulp.task('gzip', ['html', 'css', 'js', 'fonts'], function() {
gulp.src('./dist/**/!(*.gz)') gulp.src('../bin/assets/**/!(*.gz)')
.pipe(gzip()) .pipe(gzip())
.pipe(gulp.dest('./dist')); .pipe(gulp.dest('../bin/assets'));
}); });
gulp.task('gzip:watch', function() { gulp.task('gzip:watch', function() {
gulp.src('./dist/**/*.{html,css,js}') gulp.src('../bin/assets/**/*.{html,css,js}')
.pipe(gzip()) .pipe(gzip())
.pipe(gulp.dest('./dist')); .pipe(gulp.dest('../bin/assets'));
}); });
gulp.task('watch', ['default'], function() { gulp.task('watch', ['default'], function() {
gulp.watch('./dist/**/*.{html,css,js}', ['gzip:watch']) gulp.watch('../bin/assets/**/*.{html,css,js}', ['gzip:watch'])
gulp.watch('./src/*.html', ['html']); gulp.watch('./src/*.html', ['html']);
gulp.watch('./src/css/*.css', ['css']); gulp.watch('./src/css/*.css', ['css']);
return js(true); return js(true);

View File

@ -94,7 +94,7 @@ func main() {
channelStore = storage.NewChannelStore() channelStore = storage.NewChannelStore()
sessions = make(map[string]*Session) sessions = make(map[string]*Session)
fs = http.FileServer(http.Dir("client/dist")) fs = http.FileServer(http.Dir("assets"))
files = []File{ files = []File{
File{"/bundle.js", "text/javascript"}, File{"/bundle.js", "text/javascript"},