From bfbdb6b0e5d7e3a6eaf6b7f2e4f0f93a09e82c17 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Fri, 21 Sep 2018 12:00:12 +0200 Subject: [PATCH] Added OS notification when webpack failed to compile the project --- package.json | 2 +- webpack/dev.babel.js | 20 ++++++++++++-------- webpack/production.babel.js | 2 -- yarn.lock | 14 +++++++++----- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 27532f4c..39397433 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "ethereumjs-units": "^0.2.0", "ethereumjs-util": "^5.1.4", "git-revision-webpack-plugin": "^3.0.3", - "flow-webpack-plugin": "^1.2.0", "hdkey": "^0.8.0", "html-webpack-plugin": "^3.2.0", "jest-fetch-mock": "^1.6.5", @@ -63,6 +62,7 @@ "trezor-connect": "^5.0.32", "web3": "1.0.0-beta.35", "webpack": "^4.16.3", + "webpack-build-notifier": "^0.1.29", "webpack-bundle-analyzer": "^2.13.1", "whatwg-fetch": "^2.0.4", "yarn-run-all": "^3.1.1" diff --git a/webpack/dev.babel.js b/webpack/dev.babel.js index f39a2e6e..0d020d5f 100644 --- a/webpack/dev.babel.js +++ b/webpack/dev.babel.js @@ -1,9 +1,10 @@ import webpack from 'webpack'; import GitRevisionPlugin from 'git-revision-webpack-plugin'; import HtmlWebpackPlugin from 'html-webpack-plugin'; -import FlowWebpackPlugin from 'flow-webpack-plugin'; +import WebpackBuildNotifierPlugin from 'webpack-build-notifier'; -import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; +// turn on for bundle analyzing +// import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import { SRC, BUILD, PORT, PUBLIC, @@ -93,10 +94,13 @@ module.exports = { hints: false, }, plugins: [ + new WebpackBuildNotifierPlugin({ + title: 'Trezor Wallet', + suppressSuccess: true, + }), new webpack.DefinePlugin({ COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()), }), - new FlowWebpackPlugin(), new HtmlWebpackPlugin({ chunks: ['index'], template: `${SRC}index.html`, @@ -104,11 +108,11 @@ module.exports = { inject: true, favicon: `${SRC}images/favicon.ico`, }), - new BundleAnalyzerPlugin({ - openAnalyzer: false, - analyzerMode: false, // turn on to generate bundle pass 'static' - reportFilename: 'bundle-report.html', - }), + // new BundleAnalyzerPlugin({ + // openAnalyzer: false, + // analyzerMode: false, // turn on to generate bundle pass 'static' + // reportFilename: 'bundle-report.html', + // }), new webpack.optimize.OccurrenceOrderPlugin(), new webpack.NoEmitOnErrorsPlugin(), new webpack.HotModuleReplacementPlugin(), diff --git a/webpack/production.babel.js b/webpack/production.babel.js index 95932ddd..3761cec3 100644 --- a/webpack/production.babel.js +++ b/webpack/production.babel.js @@ -3,7 +3,6 @@ import webpack from 'webpack'; import GitRevisionPlugin from 'git-revision-webpack-plugin'; import HtmlWebpackPlugin from 'html-webpack-plugin'; import CopyWebpackPlugin from 'copy-webpack-plugin'; -import FlowWebpackPlugin from 'flow-webpack-plugin'; import { SRC, BUILD, PUBLIC } from './constants'; const gitRevisionPlugin = new GitRevisionPlugin(); @@ -67,7 +66,6 @@ module.exports = { new webpack.DefinePlugin({ COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()), }), - new FlowWebpackPlugin(), new HtmlWebpackPlugin({ chunks: ['index'], template: `${SRC}index.html`, diff --git a/yarn.lock b/yarn.lock index 2d274b77..75d14975 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4310,10 +4310,6 @@ flow-parser@^0.*: version "0.72.0" resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.72.0.tgz#6c8041e76ac7d0be1a71ce29c00cd1435fb6013c" -flow-webpack-plugin@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/flow-webpack-plugin/-/flow-webpack-plugin-1.2.0.tgz#1958821d16135028e391cad5ee2f3a4fa78197ec" - flush-write-stream@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.2.tgz#c81b90d8746766f1a609a46809946c45dd8ae417" @@ -7017,7 +7013,7 @@ node-libs-browser@^2.0.0: util "^0.10.3" vm-browserify "0.0.4" -node-notifier@^5.2.1: +node-notifier@5.2.1, node-notifier@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" dependencies: @@ -10900,6 +10896,14 @@ webpack-addons@^1.1.5: dependencies: jscodeshift "^0.4.0" +webpack-build-notifier@^0.1.29: + version "0.1.29" + resolved "https://registry.yarnpkg.com/webpack-build-notifier/-/webpack-build-notifier-0.1.29.tgz#d71f89bb94346c6b748e07aa3d117d2beb0a151f" + dependencies: + ansi-regex "^2.0.0" + node-notifier "5.2.1" + strip-ansi "^3.0.1" + webpack-bundle-analyzer@^2.13.1: version "2.13.1" resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.13.1.tgz#07d2176c6e86c3cdce4c23e56fae2a7b6b4ad526"