From a86f2720bc856caef5111a352dae5d6751dac32b Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 27 Oct 2016 10:16:10 +0100 Subject: [PATCH] Avoid errors if olm is missing If olm isn't installed, webpack prints out scary warnings (though it still actually succeeds). Let's avoid scaring people by quietly removing it from the list of things to process. --- webpack.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index bfd233b586..e1336f40fb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -102,3 +102,12 @@ module.exports = { ], devtool: 'source-map' }; + +// olm is an optional dependency. Ignore it if it's not installed, to avoid a +// scary-looking error. +try { + require('olm'); +} catch (e) { + console.log("Olm is not installed; not shipping it"); + delete(module.exports.entry["olm"]); +}