Use dist as output folder

master
Alexander Surma 2015-05-06 14:25:08 +01:00
parent 87cb93f25c
commit f89f480f18
2 changed files with 22 additions and 22 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ gulp-cache
.DS_Store .DS_Store
docs/out docs/out
.publish .publish
/dist

View File

@ -84,7 +84,9 @@ gulp.task('images', function () {
gulp.task('fonts', function () { gulp.task('fonts', function () {
return gulp.src([ return gulp.src([
'fonts/*' 'fonts/*'
]).pipe(gulp.dest('.tmp/fonts')); ])
.pipe(gulp.dest('.tmp/fonts'))
.pipe(gulp.dest('dist/fonts'));
}); });
// Compile and Automatically Prefix Stylesheets (dev) // Compile and Automatically Prefix Stylesheets (dev)
@ -125,11 +127,13 @@ gulp.task('styletemplates', function () {
.pipe($.concat('material.css.template')) .pipe($.concat('material.css.template'))
.pipe($.header(banner, {pkg: pkg})) .pipe($.header(banner, {pkg: pkg}))
.pipe(gulp.dest('./css')) .pipe(gulp.dest('./css'))
.pipe(gulp.dest('./dist'))
// Minify Styles // Minify Styles
.pipe($.if('*.css.template', $.csso())) .pipe($.if('*.css.template', $.csso()))
.pipe($.concat('material.min.css.template')) .pipe($.concat('material.min.css.template'))
.pipe($.sourcemaps.write('./')) .pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('./css')) .pipe(gulp.dest('./css'))
.pipe(gulp.dest('./dist'))
.pipe($.size({title: 'styles'})); .pipe($.size({title: 'styles'}));
}); });
@ -154,12 +158,14 @@ gulp.task('styles', ['styletemplates'], function () {
.pipe($.concat('material.css')) .pipe($.concat('material.css'))
.pipe($.header(banner, {pkg: pkg})) .pipe($.header(banner, {pkg: pkg}))
.pipe(gulp.dest('./css')) .pipe(gulp.dest('./css'))
.pipe(gulp.dest('./dist'))
// Minify Styles // Minify Styles
.pipe($.if('*.css', $.csso())) .pipe($.if('*.css', $.csso()))
.pipe($.concat('material.min.css')) .pipe($.concat('material.min.css'))
//.pipe($.header(banner, {pkg: pkg})) //.pipe($.header(banner, {pkg: pkg}))
.pipe($.sourcemaps.write('./')) .pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('./css')) .pipe(gulp.dest('./css'))
.pipe(gulp.dest('./dist'))
.pipe($.size({title: 'styles'})); .pipe($.size({title: 'styles'}));
}); });
@ -196,23 +202,25 @@ gulp.task('scripts', function () {
.pipe($.concat('material.js')) .pipe($.concat('material.js'))
.pipe($.header(banner, {pkg: pkg})) .pipe($.header(banner, {pkg: pkg}))
.pipe(gulp.dest('./js')) .pipe(gulp.dest('./js'))
.pipe(gulp.dest('./dist'))
// Minify Scripts // Minify Scripts
.pipe($.uglify({preserveComments: 'some', sourceRoot: '.', sourceMapIncludeSources: true})) .pipe($.uglify({preserveComments: 'some', sourceRoot: '.', sourceMapIncludeSources: true}))
.pipe($.concat('material.min.js')) .pipe($.concat('material.min.js'))
// Write Source Maps // Write Source Maps
.pipe($.sourcemaps.write('./')) .pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('./js')) .pipe(gulp.dest('./js'))
.pipe(gulp.dest('./dist'))
.pipe($.size({title: 'scripts'})); .pipe($.size({title: 'scripts'}));
}); });
// Clean Output Directory // Clean Output Directory
gulp.task('clean', del.bind(null, ['css/*', 'js/*'], {dot: true})); gulp.task('clean', del.bind(null, ['css/*', 'js/*', 'dist'], {dot: true}));
// Build Production Files, the Default Task // Build Production Files, the Default Task
gulp.task('default', ['clean','mocha'], function (cb) { gulp.task('default', ['clean','mocha'], function (cb) {
runSequence( runSequence(
'styles', 'styles',
['jshint', 'scripts', 'images'], ['jshint', 'scripts', 'fonts', 'styles', 'assets', 'pages', 'demos', 'templates'],
cb); cb);
}); });
@ -292,7 +300,7 @@ gulp.task('components', function() {
.pipe($.rename(function (path) { .pipe($.rename(function (path) {
path.basename = "index"; path.basename = "index";
})) }))
.pipe(gulp.dest('docs/out/components')); .pipe(gulp.dest('dist/components'));
}); });
@ -312,7 +320,7 @@ gulp.task('demos', function () {
extensionsAllowed: ['.svg'], extensionsAllowed: ['.svg'],
})) }))
.pipe($.if('*.css', $.autoprefixer(AUTOPREFIXER_BROWSERS))) .pipe($.if('*.css', $.autoprefixer(AUTOPREFIXER_BROWSERS)))
.pipe(gulp.dest('docs/out/components')); .pipe(gulp.dest('dist/components'));
}); });
@ -330,7 +338,7 @@ gulp.task('pages', ['components'], function() {
path.basename = 'index'; path.basename = 'index';
} }
})) }))
.pipe(gulp.dest('docs/out')); .pipe(gulp.dest('dist'));
}); });
@ -343,7 +351,7 @@ gulp.task('assets', function () {
progressive: true, progressive: true,
interlaced: true interlaced: true
}))) })))
.pipe(gulp.dest('docs/out/assets')); .pipe(gulp.dest('dist/assets'));
}); });
@ -354,7 +362,7 @@ gulp.task('serve', ['scripts', 'styles', 'assets', 'pages', 'demos', 'templates'
browserSync({ browserSync({
notify: false, notify: false,
server: { server: {
baseDir: ['docs/out', 'js', 'css', 'fonts'], baseDir: ['dist', 'js', 'css', 'fonts'],
routes: { routes: {
'/fonts': 'fonts', '/fonts': 'fonts',
'/components/fonts': 'fonts' '/components/fonts': 'fonts'
@ -376,16 +384,7 @@ gulp.task('publish', ['default', 'templates', 'assets', 'pages', 'demos'], funct
console.log('Dry run! To push set $GH_PUSH to true'); console.log('Dry run! To push set $GH_PUSH to true');
} }
var s1 = gulp.src([ return gulp.src('dist/**/*')
'docs/out/**/*',
'css/material.min.css',
'js/material.min.js'
]);
var s2 = gulp.src([
'fonts/**/*'
], {base: '.'});
return merge(s1, s2)
.pipe($.ghPages({ .pipe($.ghPages({
push: push, push: push,
})); }));
@ -405,7 +404,7 @@ gulp.task('templates:styles', function() {
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS)) .pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
.pipe($.if('*.css', $.csso())) .pipe($.if('*.css', $.csso()))
.pipe($.rename({suffix: '.min'})) .pipe($.rename({suffix: '.min'}))
.pipe(gulp.dest('docs/out/templates')) .pipe(gulp.dest('dist/templates'))
}); });
gulp.task('templates:static', function() { gulp.task('templates:static', function() {
@ -413,7 +412,7 @@ gulp.task('templates:static', function() {
'templates/**/*.html', 'templates/**/*.html',
'templates/**/*.css' 'templates/**/*.css'
]) ])
.pipe(gulp.dest('docs/out/templates')); .pipe(gulp.dest('dist/templates'));
}); });
gulp.task('templates:images', function() { gulp.task('templates:images', function() {
@ -424,14 +423,14 @@ gulp.task('templates:images', function() {
progressive: true, progressive: true,
interlaced: true interlaced: true
})) }))
.pipe(gulp.dest('docs/out/templates')); .pipe(gulp.dest('dist/templates'));
}); });
gulp.task('templates:fonts', function() { gulp.task('templates:fonts', function() {
return gulp.src([ return gulp.src([
'fonts/**/*' 'fonts/**/*'
], {base: '.'}) ], {base: '.'})
.pipe(gulp.dest('docs/out/templates/')); .pipe(gulp.dest('dist/templates/'));
}) })
gulp.task('templates', ['templates:static', 'templates:images', 'templates:styles', 'templates:fonts']); gulp.task('templates', ['templates:static', 'templates:images', 'templates:styles', 'templates:fonts']);