diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
commit | 7ae38906926dc09bc10670c361af0d2bf0050426 (patch) | |
tree | 5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/testnet-faucets/gulpfile.js | |
parent | b5fd3c72a08aaa6957917d74c333387a16edf66b (diff) | |
download | dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.bz2 dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.lz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.xz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip |
Update dependency packages
Diffstat (limited to 'packages/testnet-faucets/gulpfile.js')
-rw-r--r-- | packages/testnet-faucets/gulpfile.js | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/packages/testnet-faucets/gulpfile.js b/packages/testnet-faucets/gulpfile.js deleted file mode 100644 index 839ef851b..000000000 --- a/packages/testnet-faucets/gulpfile.js +++ /dev/null @@ -1,91 +0,0 @@ -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, '/server'), - 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: /server|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, 'server/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); - process.exit(1); - } else { - console.log(stats.toString()); - } - if (done) { - if (stats.compilation.errors && stats.compilation.errors.length > 0) { - process.exit(1); - } - done(); - } - }; -} |