diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-08-26 13:35:57 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-08-28 17:19:00 +0200 |
| commit | ca022b8540b993a2f6bcdb6f33c751f4b5a56b58 (patch) | |
| tree | 319285377f6e5e19abd513a9194f3685d9a4d9a4 /gui/tasks/scripts.js | |
| parent | 40f2a6d3397694d3bb0d4025daee00f61f9c92d4 (diff) | |
| download | mullvadvpn-ca022b8540b993a2f6bcdb6f33c751f4b5a56b58.tar.xz mullvadvpn-ca022b8540b993a2f6bcdb6f33c751f4b5a56b58.zip | |
Switch build pipeline to Gulp
Diffstat (limited to 'gui/tasks/scripts.js')
| -rw-r--r-- | gui/tasks/scripts.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gui/tasks/scripts.js b/gui/tasks/scripts.js new file mode 100644 index 0000000000..8fc7155d4b --- /dev/null +++ b/gui/tasks/scripts.js @@ -0,0 +1,32 @@ +const { parallel, series, src, dest } = require('gulp'); +const envify = require('gulp-envify'); +const ts = require('gulp-typescript'); + +const TscWatchClient = require('tsc-watch/client'); + +function makeWatchCompiler(onFirstSuccess) { + const compileScripts = function() { + const watch = new TscWatchClient(); + watch.on('first_success', onFirstSuccess); + watch.start('--noClear', '--sourceMap', '--project', '.'); + return watch.tsc; + }; + compileScripts.displayName = 'compile-scripts-watch'; + + return compileScripts; +} + +function compileScripts() { + const tsProject = ts.createProject('tsconfig.json'); + + return tsProject + .src() + .pipe(tsProject()) + .pipe(envify({ NODE_ENV: 'production' })) + .pipe(dest('build')); +} + +compileScripts.displayName = 'compile-scripts'; + +exports.build = compileScripts; +exports.makeWatchCompiler = makeWatchCompiler; |
