-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathGulpfile.js
More file actions
45 lines (44 loc) · 1.31 KB
/
Copy pathGulpfile.js
File metadata and controls
45 lines (44 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var browserSync = require('browser-sync');
const reload = browserSync.reload;
gulp.task('copy', () =>
gulp.src([
'build/**/*'
], {
base: './'
}).pipe(gulp.dest('demo'))
);
// jshint files
gulp.task('jshint', function () {
//gulp.src(['test/**/*.js'])
// .pipe(jshint())
// .pipe(jshint.reporter());
});
// start local http server for development
gulp.task('http-server', function () {
browserSync({
notify: false,
// Customize the Browsersync console logging prefix
logPrefix: 'WSK',
// Allow scroll syncing across breakpoints
scrollElementMapping: ['main', '.mdl-layout'],
// Run as an https by uncommenting 'https: true'
// Note: this uses an unsigned certificate which on first access
// will present a certificate warning in the browser.
// https: true,
server: ['.tmp', 'demo'],
port: 3000
});
gulp.watch(['demo/**/*'], reload);
});
// start local http server with watch and livereload set up
gulp.task('server', function () {
gulp.run('http-server');
});
gulp.task('default', function () {
gulp.run('jshint', 'copy', 'server');
});
gulp.task('serve', function () {
gulp.run('default');
});