From 7cd1aa142186c3307ba25305cc96640d86d1e790 Mon Sep 17 00:00:00 2001 From: Yevhen Laichenkov Date: Wed, 27 Sep 2023 23:55:14 +0300 Subject: [PATCH] update(docs): change node polyfill for cucumber --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e7aa0c2..255892f 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,12 @@ Additionally, you may need to install and add node polyfill in your `support/e2e 1. Install the polyfill module: ```bash -npm i -D @esbuild-plugins/node-modules-polyfill +npm i -D esbuild-plugin-polyfill-node ``` 2. Import the following code in your `support/e2e.js` file: ```js -const { NodeModulesPolyfillPlugin } = require('@esbuild-plugins/node-modules-polyfill'); +const { polyfillNode } = require('esbuild-plugin-polyfill-node'); ``` 3. Add the following code in your `plugins` property: @@ -64,14 +64,12 @@ module.exports = defineConfig({ e2e: { async setupNodeEvents(on, config) { const bundler = createBundler({ - // add polyfill ⬇ NodeModulesPolyfillPlugin - plugins: [NodeModulesPolyfillPlugin(), createEsbuildPlugin(config)], + plugins: [polyfillNode({ polyfills: { crypto: true } }), createEsbuildPlugin(config)], }); } } }); ``` -Moreover, you can take a look at the [comment](https://github.com/elaichenkov/cy-verify-downloads/issues/51#issuecomment-1237978973) with detailed example of adding node polyfill in your config. **For Cypress v9:**