forked from akiran/react-highlight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (29 loc) · 1021 Bytes
/
gulpfile.js
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
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
gulp.task('copy', function () {
gulp.src('./docs/index.html')
.pipe(gulp.dest('build'));
});
gulp.task('sass', function () {
return gulp.src(['./docs/**/*.scss'])
.pipe(sass({ loadPath : ['bower_components', 'node_modules'],}))
.on('error', function (err) { console.log(err.message); })
.pipe(gulp.dest('./build'));
});
gulp.task('server', ['copy', 'sass'], function (callback) {
var myConfig = require('./webpack.config.js');
var webpackCompiler = webpack(myConfig, function(err, stats) {
});
new WebpackDevServer(webpackCompiler, {
contentBase: './build',
hot: true,
debug: true
}).listen(8000, 'localhost', function (err, result) {
});
});
gulp.task('watch', function () {
gulp.watch(['./docs/**/*{scss,sass}'], ['sass']);
gulp.watch(['./docs/index.html'], ['copy']);
});