Skip to content

Commit f4a3e9a

Browse files
authored
Merge pull request element-hq#1675 from vector-im/rav/olmify_develop
Another go at enabling olm on vector.im/develop
2 parents 654429d + bb820be commit f4a3e9a

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Building From Source
2222
If you do wish to build vector from source:
2323

2424
1. Install or update `node.js` so that your `npm` is at least at version `2.0.0`
25-
1. Clone the repo: `git clone https://github.com/vector-im/vector-web.git`
25+
1. Clone the repo: `git clone https://github.com/vector-im/vector-web.git`
2626
1. Switch to the vector directory: `cd vector-web`
2727
1. Install the prerequisites: `npm install`
2828
1. If you are using the `develop` branch of vector, you will probably need to
@@ -60,8 +60,6 @@ Much of the functionality in Vector is actually in the `matrix-react-sdk` and
6060
easy to track the `develop` branches in git and to make local changes without
6161
having to manually rebuild each time.
6262

63-
[Be aware that there may be problems with this process under npm version 3.]
64-
6563
First clone and build `matrix-js-sdk`:
6664

6765
1. `git clone git@github.com:matrix-org/matrix-js-sdk.git`
@@ -123,10 +121,7 @@ day-to-day use; it is experimental and should be considered only as a
123121
proof-of-concept. See https://matrix.org/jira/browse/SPEC-162 for an overview
124122
of the current progress.
125123
126-
To build a version of vector with support for end-to-end encryption, install
127-
the olm module with `npm i https://matrix.org/packages/npm/olm/olm-0.1.0.tgz`
128-
before running `npm start`. The olm library will be detected and used if
129-
available.
124+
Vector is built with support for end-to-end encryption by default.
130125
131126
To enable encryption for a room, type
132127
@@ -142,4 +137,4 @@ Note that historical encrypted messages cannot currently be decoded - history
142137
is therefore lost when the page is reloaded.
143138
144139
There is currently no visual indication of whether encryption is enabled for a
145-
room, or whether a particular message was encrypted.
140+
room.

webpack.config.js

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ var path = require('path');
22
var webpack = require('webpack');
33
var ExtractTextPlugin = require("extract-text-webpack-plugin");
44

5-
var olm_path = path.resolve('./node_modules/olm');
6-
75
module.exports = {
86
module: {
97
preLoaders: [
@@ -45,11 +43,6 @@ module.exports = {
4543

4644
// same goes for js-sdk
4745
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
48-
49-
// matrix-js-sdk will use olm if it is available,
50-
// but does not explicitly depend on it. Pull it
51-
// in from node_modules if it's there.
52-
olm: olm_path,
5346
},
5447
},
5548
plugins: [
@@ -65,20 +58,17 @@ module.exports = {
6558

6659
// olm.js includes "require 'fs'", which is never
6760
// executed in the browser. Ignore it.
68-
new webpack.IgnorePlugin(/^fs$/, /node_modules\/olm$/)
61+
new webpack.IgnorePlugin(/^fs$/, /\/olm$/)
6962
],
7063
devtool: 'source-map'
7164
};
7265

73-
// ignore olm.js if it's not installed.
74-
(function() {
75-
var fs = require('fs');
76-
try {
77-
fs.lstatSync(olm_path);
78-
console.log("Olm is installed; including it in webpack bundle");
79-
} catch (e) {
80-
module.exports.plugins.push(
81-
new webpack.IgnorePlugin(/^olm$/)
82-
);
83-
}
84-
}) ();
66+
// ignore olm.js if it's not installed, to avoid a scary-looking error.
67+
try {
68+
require('olm');
69+
console.log("Olm is installed; including it in webpack bundle");
70+
} catch (e) {
71+
module.exports.plugins.push(
72+
new webpack.IgnorePlugin(/^olm$/)
73+
);
74+
}

0 commit comments

Comments
 (0)