Merge pull request #7552 from vector-im/travis/permalink-routing

Mock fs, tls, and net to support request in the browser
This commit is contained in:
Travis Ralston 2018-10-26 14:22:38 -06:00 committed by GitHub
commit cebba5bfa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2470 additions and 5992 deletions

8448
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -125,6 +125,7 @@
"karma-webpack": "4.0.0-beta.0",
"matrix-mock-request": "^1.2.0",
"matrix-react-test-utils": "^0.2.0",
"memfs": "^2.10.1",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"mocha": "^5.2.0",

View File

@ -106,8 +106,21 @@ module.exports = {
// same goes for js-sdk
"matrix-js-sdk": path.resolve('./node_modules/matrix-js-sdk'),
// To make webpack happy
// Related: https://github.com/request/request/issues/1529
// (there's no mock available for fs, so we fake a mock by using
// an in-memory version of fs)
"fs": "memfs",
},
},
node: {
// Because webpack is made of fail
// https://github.com/request/request/issues/1529
// Note: 'mock' is the new 'empty'
net: 'mock',
tls: 'mock'
},
externals: {
// Don't try to bundle electron: leave it as a commonjs dependency
// (the 'commonjs' here means it will output a 'require')