From f508e497fa4e25cb45e31f7c3197d1964a1d4fb4 Mon Sep 17 00:00:00 2001 From: Gary50613 <50613gary@gmail.com> Date: Mon, 4 Mar 2024 22:59:10 +0800 Subject: [PATCH] no need for extra webpack config --- README.md | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/README.md b/README.md index 41da6af..667235a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Connect to your Redis server using `cloudflare:sockets`. This package is designed to work with Cloudflare Workers, but it can also be used in node.js thanks to the implementation of [`cloudflare:sockets` for node.js](https://github.com/Ethan-Arrowood/socket). -For next.js users, please see the [Node.js, Next.js local development](#nodejs-nextjs-local-development) section. - ## Installation ```sh @@ -52,7 +50,7 @@ const decoder = new TextDecoder(); console.log(decoder.decode(value)); // bar ``` -### Node.js, Next.js local development +### Node.js Please install the node.js polyfill for `cloudflare:sockets` to use this package in node.js. @@ -60,23 +58,6 @@ Please install the node.js polyfill for `cloudflare:sockets` to use this package npm install @arrowood.dev/socket ``` -#### Extra webpack configuration for Next.js - -Since `cloudflare:sockets` is a runtime dependency, you need to add it to the `externals` in your `next.config.js`. - -```js -const config = { - // your next.js config - webpack: (config, { webpack }) => { - config.externals.push({ - "cloudflare:sockets": "import('cloudflare:sockets').catch(console.error)", - }); - - return config; - }, -}; -``` - ## API ### `createRedis(options: RedisOptions): Redis`