aboutsummaryrefslogtreecommitdiffstats
path: root/packages/kovan-faucets/gulpfile.js
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-16 02:37:03 +0800
committerFabio Berger <me@fabioberger.com>2017-12-16 02:37:03 +0800
commitb46dd2e0a277340c19fa137a436981cc53c8cb80 (patch)
treed2814176fe8ffc5ec6a61534aa77487aae6bcc13 /packages/kovan-faucets/gulpfile.js
parent484dd4c33aa5786def1f0b159f5b51f99a585aa8 (diff)
parent3eb08735d4d0fe4b046dd6b74f5ed503cf5c64e3 (diff)
downloaddexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.gz
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.bz2
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.lz
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.xz
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.tar.zst
dexon-sol-tools-b46dd2e0a277340c19fa137a436981cc53c8cb80.zip
Merge branch 'development' into createWethPage
* development: (54 commits) Fix redundant spaces Fix tests Fix website unused vars Fix connect unused vars Fix 0x.js unused vars Dissallow unused vars/imports Implement first custom linter rule async-suffix Reuse intervalutils in website Add a newline Name a variable Add a comment Fix a conditional Make migrations deterministic Fix linter error Fix linter errors Add a function to init token balances Rename tokenUtils.getNonProtocolTokens to tokenUtils.getDummyTokens Add DummyToken to gitignore Add DummyToken to artifacts list Increase mocha timeout ...
Diffstat (limited to 'packages/kovan-faucets/gulpfile.js')
-rw-r--r--packages/kovan-faucets/gulpfile.js92
1 files changed, 92 insertions, 0 deletions
diff --git a/packages/kovan-faucets/gulpfile.js b/packages/kovan-faucets/gulpfile.js
new file mode 100644
index 000000000..773faf33a
--- /dev/null
+++ b/packages/kovan-faucets/gulpfile.js
@@ -0,0 +1,92 @@
+const gulp = require('gulp');
+const nodemon = require('nodemon');
+const path = require('path');
+const webpack = require('webpack');
+const fs = require('fs');
+const nodeExternals = require('webpack-node-externals');
+
+const config = {
+ target: 'node',
+ entry: [path.join(__dirname, '/src/ts/server.ts')],
+ output: {
+ path: path.join(__dirname, '/bin'),
+ filename: 'server.js',
+ },
+ devtool: 'source-map',
+ resolve: {
+ modules: [
+ path.join(__dirname, '/src/ts'),
+ 'node_modules',
+ ],
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
+ alias: {
+ ts: path.join(__dirname, '/src/ts'),
+ contract_artifacts: path.join(__dirname, '/src/contract_artifacts'),
+ },
+ },
+ module: {
+ rules: [
+ {
+ test: /\.js$/,
+ loader: 'source-map-loader',
+ },
+ {
+ test: /\.tsx?$/,
+ loader: 'awesome-typescript-loader',
+ },
+ ],
+ },
+ plugins: [
+ new webpack.BannerPlugin({
+ banner: 'require("source-map-support").install();',
+ raw: true,
+ entryOnly: false,
+ }),
+ ],
+ externals: nodeExternals({
+ modulesDir: path.join(__dirname, '../../node_modules')
+ }),
+ watchOptions: {
+ ignored: /bin|node_modules|transpiled/
+ },
+};
+
+gulp.task('build', function(done) {
+ webpack(config).run(onBuild(done));
+});
+
+gulp.task('watch', function() {
+ webpack(config).watch(100, function(err, stats) {
+ onBuild()(err, stats);
+ nodemon.restart();
+ });
+});
+
+gulp.task('run', ['watch'], function() {
+ nodemon({
+ execMap: {
+ js: 'node',
+ },
+ script: path.join(__dirname, 'bin/server'),
+ ignore: ['*'],
+ watch: ['foo/'],
+ ext: 'noop',
+ }).on('restart', function() {
+ console.log('Restarted!');
+ });
+});
+
+function onBuild(done) {
+ return function(err, stats) {
+ if(err) {
+ console.log('Error', err);
+ }
+ else {
+ console.log(stats.toString());
+ }
+
+ if(done) {
+ done();
+ }
+ }
+}