forked from HelpfulHuman/React-Project-LEGACY-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·49 lines (43 loc) · 1.22 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
require('dotenv').load();
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var ui = require('helpful-ui')();
var webpack = require('webpack');
var port = process.env.PORT || 9700;
/**
* Compile Stylus files into CSS and apply vendor prefixes for us
* automatically.
*/
gulp.task('styles', function () {
return gulp
.src('./src/index.styl')
.pipe(plugins.sourcemaps.init())
.pipe(plugins.stylus({ use: [ui] }))
.pipe(plugins.autoprefixer())
.pipe(plugins.rename({ basename: 'app' }))
.pipe(gulp.dest('./build'))
.pipe(plugins.sourcemaps.write('./build'));
});
/**
* Run a webpack build once.
*/
gulp.task('scripts', function (done) {
webpack(require('./webpack.config'), done);
});
/**
* Single task for compiling everything once.
*/
gulp.task('build', ['styles', 'scripts']);
/**
* Starts up the live-reloading development server. Currently,
* only Javascript changes invoke a live reload but we're working
* on adding support to reload Stylus changes as well.
*/
gulp.task('dev-server', ['styles'], function () {
gulp.watch('./**/*.styl', ['styles']);
require('./dev-server');
});
/**
* Default task for when "gulp" is run.
*/
gulp.task('default', ['build']);