From 3ea9a1c311c3e3c55fb95560d4dd99a77c52df4a Mon Sep 17 00:00:00 2001 From: William Lahti Date: Thu, 28 Jun 2018 06:53:04 -0700 Subject: Replace angular-cli patch with something less risky (#742) * Replace angular-cli patch with something less risky * path.join() is needed, provide a naive implementation * technically, webpack provided a polyfill for Buffer, we should too * process polyfill matches webpack; peertube depends on nextTick * polyfill for path to match webpack * http/https polyfills as per webpack --- client/src/shims/http.ts | 1 + client/src/shims/https.ts | 1 + client/src/shims/noop.ts | 3 +++ client/src/shims/path.ts | 1 + 4 files changed, 6 insertions(+) create mode 100644 client/src/shims/http.ts create mode 100644 client/src/shims/https.ts create mode 100644 client/src/shims/noop.ts create mode 100644 client/src/shims/path.ts (limited to 'client/src/shims') diff --git a/client/src/shims/http.ts b/client/src/shims/http.ts new file mode 100644 index 000000000..a759400cb --- /dev/null +++ b/client/src/shims/http.ts @@ -0,0 +1 @@ +module.exports = require('stream-http'); \ No newline at end of file diff --git a/client/src/shims/https.ts b/client/src/shims/https.ts new file mode 100644 index 000000000..1da6f8adb --- /dev/null +++ b/client/src/shims/https.ts @@ -0,0 +1 @@ +module.exports = require('https-browserify'); \ No newline at end of file diff --git a/client/src/shims/noop.ts b/client/src/shims/noop.ts new file mode 100644 index 000000000..338e16104 --- /dev/null +++ b/client/src/shims/noop.ts @@ -0,0 +1,3 @@ +// Does nothing. Used to shim out node.js modules +// which are no-ops in the browser. +export const NOOP = 0; \ No newline at end of file diff --git a/client/src/shims/path.ts b/client/src/shims/path.ts new file mode 100644 index 000000000..74b6913d8 --- /dev/null +++ b/client/src/shims/path.ts @@ -0,0 +1 @@ +module.exports = require('path-browserify'); \ No newline at end of file -- cgit v1.2.3