Skip to content

Commit a86f272

Browse files
committed
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.
1 parent b174d49 commit a86f272

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

webpack.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,12 @@ module.exports = {
102102
],
103103
devtool: 'source-map'
104104
};
105+
106+
// olm is an optional dependency. Ignore it if it's not installed, to avoid a
107+
// scary-looking error.
108+
try {
109+
require('olm');
110+
} catch (e) {
111+
console.log("Olm is not installed; not shipping it");
112+
delete(module.exports.entry["olm"]);
113+
}

0 commit comments

Comments
 (0)