From f54702396f869adef6e22d04d39d4e0f436195c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Marohni=C4=87?= Date: Sun, 27 Dec 2015 04:39:53 +0100 Subject: [PATCH] Add tip for compiling with webpack Refs andris9/encoding#16. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 270a3e3..6105ec1 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,19 @@ fetch('//offline-news-api.herokuapp.com/stories') }); ``` +### webpack + +If you're using webpack with `target: node` (e.g. for testing), you can avoid warnings about the dynamic `require` by adding the following to your configuration ([more info](andris9/encoding#16)): + +```js +{ + module: { + exprContextRegExp: /$^/, + exprContextCritical: false + } +} +``` + ## License All open source code released by FT Labs is licenced under the MIT licence. Based on [the fine work by](https://github.com/github/fetch/pull/31) **[jxck](https://github.com/Jxck)**.