forked from freenas/gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
51 lines (41 loc) · 1.41 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
50
51
// GULPFILE
// ========
// Entry point for the live development environment. Automatically builds and
// transpiles the GUI's source code with inteligent watchers and pipelines.
"use strict";
var gulp = require( "gulp" );
var path = require( "path" );
var runSequence = require( "run-sequence" );
var env = require( "gulp-env" );
var argv = require( "yargs" ).argv;
var prettyPrint = require( "./gulp_common/prettyPrint" );
// Load all independent tasks defined in the gulp_tasks directory, including
// those in subdirectories.
require( "require-dir" )( "./gulp_tasks/", { recurse: true } );
gulp.task( "default", function ( callback ) {
process.env.NODE_ENV = process.env.NODE_ENV || "development";
runSequence( [ "clean", "install-packages" ]
, "serve"
, "webpack-dev-server"
, callback
);
});
gulp.task( "deploy", function ( callback ) {
if ( !argv.output ) {
throw new Error( "An --output was not set!" );
callback();
}
process.env.NODE_ENV = "production";
prettyPrint.tag( "bgBlue"
, "DEPLOY"
, "Creating deployment in "
+ path.join( __dirname, argv.output )
);
runSequence( [ "clean", "install-packages" ]
, [ "package-scripts"
, "package-build"
]
, "package-node-modules"
, callback
);
});