From 221ac6b969a15f6b39658d029577eed9dcc3a13f Mon Sep 17 00:00:00 2001 From: dcharbonnier Date: Thu, 29 Mar 2018 09:11:24 +0200 Subject: [PATCH] add FAQ with webpack --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9593df6..2fe7baa 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,16 @@ try { } catch { // the auth failed } - ``` + +### FAQ +#### Webpack +Webpack complain about the `ws` implementation of WebSocket, the errors are : +`Can't resolve 'net'` and `Can't resolve 'tls'`. + +The solution consist in ignoring the ws module that can't be used in a browser (and not required), the polyfill will detect the browser implementation of the WebSocket and use it. +To ignore the module, add a rule to your webpack config file : + `{test: /[\/\\]node_modules[\/\\]ws[\/\\].+\.js$/, use: 'null-loader'},` + +