{"_id":"@cypress/vite-plugin-cypress-esm","_rev":"6-c639751a990857123cd3a7fe954a2550","name":"@cypress/vite-plugin-cypress-esm","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@cypress/vite-plugin-cypress-esm","version":"1.0.0","license":"MIT","_id":"@cypress/vite-plugin-cypress-esm@1.0.0","maintainers":[{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"}],"homepage":"https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm#readme","bugs":{"url":"https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm"},"dist":{"shasum":"de3d96d66199b1e25481bbe05d7f0d67e1014436","tarball":"https://registry.npmjs.org/@cypress/vite-plugin-cypress-esm/-/vite-plugin-cypress-esm-1.0.0.tgz","fileCount":7,"integrity":"sha512-ZoMvsJKZrvU8LY7pZ1LuhPyWbAAsd0RUnlsTBnfeMn7WeeG8jI9R3I2Xt3bH3UtG8Lv5QJ46Rc5jSdHM7ulrgA==","signatures":[{"sig":"MEQCIDGUGgydNcRzz/odzHEgGbTUlAdgx5Y796lqXxRaySPQAiA/rEN8qhBgOskOBbGDQy4ltEyDCHubVUxPrn9EQHsEjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkU3YtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpfMw/9FBqRIX0NglFE8dE4SrFgKkDnIKmOVMcDn7xAVqP5kveDH9B3\r\nuT0NKmPT7KoDDILD9UAvKIFzWeYwxMpo3ZusZEaxZgeBVQkza6lfZhEoV4i2\r\nWTjSGFi+CSw8HRQlR1qQED/7X2lD72SP4yBUh95gRPsVhVX18nKnvvz5humW\r\nVXP/SEt9l5wUh7eVOK6CmypkjAUCTv+0AxfBWP38IAuNCo8uNxKdxTa8+/v7\r\n4A0pv0R/tioML8E1zr0c+RH9OJVGHweuSeBdxOLKlqlc7ylw290lA1VvvWYN\r\n2BC2uZEKkraOeMkgrs7mNODLHqdsVKW+AokT3yppv1zFXPUJWi9mfQZO6bpi\r\nhkX6YUKnqq40ipxeEwO3O3kKnKmO30gWvJjjdcIyxvb3QPShJ5p8+Hhk7p85\r\n5klOnJJJdJGcgcLaRZ4DBbrCD01wE2ftIauhJjAQhliIidMdcvzhnyMMM84V\r\n25GK+7/+Bae6Ot/QwBwtUrsSDX7lKmUqWw6zKf/TylXnxQNBoQl1iZmF4bAR\r\nxqBW92H9zkYwUslY23/wV1R50iborCKCAxQ8UeRB6j0qxgi3P4VteAQVv9Yc\r\nJZcznPZzOnaWqGeGB64JIIPg+L/Ywz56SXy688wOT+Eo7wf/cQtS9XLnRYEN\r\nobAifWzlRb3cEnedmcDaJtlLG36OUM/ljB4=\r\n=yn/9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"./index.d.ts","module":"dist/index.js","gitHead":"bc6e9e49187aea3a8e021c39b5faee1059f16cf7","scripts":{"lint":"eslint --ext .js,.ts,.json, .","test":"node ../../scripts/cypress run --project . --component","build":"tsc || echo 'built, with type errors'","watch":"tsc -w","check-ts":"tsc --noEmit","build-prod":"tsc || echo 'built, with type errors'","cypress:open":"node ../../scripts/cypress open --project . --component"},"_npmUser":{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"},"repository":{"url":"git+https://github.com/cypress-io/cypress.git","type":"git"},"_npmVersion":"8.12.1","description":"Make ESM Modules mutable in the browser with Cypress and Vite","directories":{},"_nodeVersion":"16.16.0","dependencies":{"debug":"^4.3.4","picomatch":"2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"4.1.4","react":"16.8.6","react-dom":"16.8.6","react-query":"3.39.3","react-router":"6.10.0","@types/picomatch":"2.3.0","react-router-dom":"6.10.0","@vitejs/plugin-react":"1.3.1"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-cypress-esm_1.0.0_1683191341648_0.36218535634821425","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@cypress/vite-plugin-cypress-esm","version":"1.0.1","license":"MIT","_id":"@cypress/vite-plugin-cypress-esm@1.0.1","maintainers":[{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"}],"homepage":"https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm#readme","bugs":{"url":"https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm"},"dist":{"shasum":"55551d3ecce1c4400da62fc60c8ea72dfd39ee37","tarball":"https://registry.npmjs.org/@cypress/vite-plugin-cypress-esm/-/vite-plugin-cypress-esm-1.0.1.tgz","fileCount":7,"integrity":"sha512-GVpC6U19sCEWbnz75h1MdHOo6wCl/f9OmsJ5of6l47E7R+wQwd40k9BCSXUYydAPUXACJozOnicOrpJbnlS2yA==","signatures":[{"sig":"MEUCIGA8aRpH36pZi3aW2XwrbNWrYTx1U9Al+Z6hWF9NGd0pAiEA7BxEzgmLjFDxAUFfmGsRYxhDzxqiP6LH6EfM/1R/Lx4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22145},"main":"index.js","types":"./index.d.ts","module":"dist/index.js","gitHead":"3df65f73e134571f315534d4da304df68ffbb114","scripts":{"lint":"eslint --ext .js,.ts,.json, .","test":"node ../../scripts/cypress run --project . --component","build":"tsc || echo 'built, with type errors'","watch":"tsc -w","check-ts":"tsc --noEmit","build-prod":"tsc || echo 'built, with type errors'","cypress:open":"node ../../scripts/cypress open --project . --component"},"_npmUser":{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"},"repository":{"url":"git+https://github.com/cypress-io/cypress.git","type":"git"},"_npmVersion":"8.12.1","description":"Make ESM Modules mutable in the browser with Cypress and Vite","directories":{},"_nodeVersion":"16.16.0","dependencies":{"debug":"^4.3.4","picomatch":"2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"4.1.4","react":"16.8.6","react-dom":"16.8.6","react-query":"3.39.3","react-router":"6.10.0","@types/picomatch":"2.3.0","react-router-dom":"6.10.0","@vitejs/plugin-react":"1.3.1"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-cypress-esm_1.0.1_1684871355445_0.7525865456877026","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@cypress/vite-plugin-cypress-esm","version":"1.1.0","license":"MIT","_id":"@cypress/vite-plugin-cypress-esm@1.1.0","maintainers":[{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"}],"homepage":"https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm#readme","bugs":{"url":"https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm"},"dist":{"shasum":"544a8e6b7f7bb6c442fcf933f5c5b7f320a81ad8","tarball":"https://registry.npmjs.org/@cypress/vite-plugin-cypress-esm/-/vite-plugin-cypress-esm-1.1.0.tgz","fileCount":7,"integrity":"sha512-80W9cguN4kkbUj7I7YjQHlS29aoqUSij0XcjGkxu1jqdoWdXPK4hzhidjmCSiLKxizXhvAM7WDFyJ6znu0PeSQ==","signatures":[{"sig":"MEUCIQDPsG9UNeoEdzZsH0wjU5fitIcAS+7nuBrTlR4F1cuIHQIgFP4uTJbUCZibO0v8V8U47j9MPsQPUZUf4HD/+mXNhnc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26886},"main":"index.js","types":"./index.d.ts","module":"dist/index.js","gitHead":"68a2976565042fc2352f53d062b895b509c877fb","scripts":{"lint":"eslint --ext .js,.ts,.json, .","test":"npm run cypress:run","build":"tsc || echo 'built, with type errors'","watch":"tsc -w","check-ts":"tsc --noEmit","build-prod":"tsc || echo 'built, with type errors'","cypress:run":"node ../../scripts/cypress run --project . --component","cypress:open":"node ../../scripts/cypress open --project . --component"},"_npmUser":{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"},"repository":{"url":"git+https://github.com/cypress-io/cypress.git","type":"git"},"_npmVersion":"8.12.1","description":"Make ESM Modules mutable in the browser with Cypress and Vite","directories":{},"_nodeVersion":"16.16.0","dependencies":{"debug":"^4.3.4","picomatch":"2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"4.1.4","react":"16.8.6","react-dom":"16.8.6","react-query":"3.39.3","react-router":"6.10.0","@types/picomatch":"2.3.0","react-router-dom":"6.10.0","@vitejs/plugin-react":"1.3.1"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-cypress-esm_1.1.0_1691390987472_0.766799878344606","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@cypress/vite-plugin-cypress-esm","version":"1.1.1","license":"MIT","_id":"@cypress/vite-plugin-cypress-esm@1.1.1","maintainers":[{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"}],"homepage":"https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm#readme","bugs":{"url":"https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm"},"nx":{"targets":{"build":{"outputs":["{projectRoot}/dist"]}}},"dist":{"shasum":"20bf7f7192a0dd6f9430bc86be8b20db2611e73c","tarball":"https://registry.npmjs.org/@cypress/vite-plugin-cypress-esm/-/vite-plugin-cypress-esm-1.1.1.tgz","fileCount":7,"integrity":"sha512-wUp71n28LTYIzQ0V+gfJ1gWGYhNASGr1T2RClD7VKmOFXqLVh5dSFbPwFXvbI32fDBDxRN5nXeErxjXyTqVD9w==","signatures":[{"sig":"MEUCIQD3Jj/YUWvXGiaqPDVrVdj5NswNg8AmLWVnWFmnKvYKLgIgIxqTc0TQ8pT4IYc4z9KvG6iCEFMvTVg+9wSnwtFHIjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27072},"main":"index.js","types":"./index.d.ts","module":"dist/index.js","gitHead":"10ce6559bb2731010a6fe2746929d4dd3cfd4762","scripts":{"lint":"eslint --ext .js,.ts,.json, .","test":"npm run cypress:run","build":"tsc || echo 'built, with type errors'","watch":"tsc -w","check-ts":"tsc --noEmit","cypress:run":"node ../../scripts/cypress run --project . --component","cypress:open":"node ../../scripts/cypress open --project . --component"},"_npmUser":{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"},"repository":{"url":"git+https://github.com/cypress-io/cypress.git","type":"git"},"_npmVersion":"8.12.1","description":"Make ESM Modules mutable in the browser with Cypress and Vite","directories":{},"_nodeVersion":"18.17.1","dependencies":{"debug":"^4.3.4","picomatch":"2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"4.5.2","react":"16.8.6","react-dom":"16.8.6","react-query":"3.39.3","react-router":"6.10.0","@types/picomatch":"2.3.0","react-router-dom":"6.10.0","@vitejs/plugin-react":"1.3.1"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-cypress-esm_1.1.1_1715365235125_0.2164463956375584","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@cypress/vite-plugin-cypress-esm","version":"1.1.2","license":"MIT","_id":"@cypress/vite-plugin-cypress-esm@1.1.2","maintainers":[{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"}],"homepage":"https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm#readme","bugs":{"url":"https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm"},"nx":{"targets":{"build":{"outputs":["{projectRoot}/dist"]}}},"dist":{"shasum":"65ca00d58985eb65f9ff28a00d1777353bdd7ec3","tarball":"https://registry.npmjs.org/@cypress/vite-plugin-cypress-esm/-/vite-plugin-cypress-esm-1.1.2.tgz","fileCount":7,"integrity":"sha512-fpa6QePha5bDplkFb18BHi2MbQuJKqmB0xeI3DPJ+pHHFkdtXVN050wnY31mdwBdmpurvuRfvwefMWf+IMlmeA==","signatures":[{"sig":"MEUCIBYpUQFNnqTBsZrO7sQkEvlBEEDDl6vlaoF4h9dntJUnAiEAz01Byu918lL9wfRIH4fVijbx5Gj94undO2pH7AhLZa0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27088},"main":"index.js","types":"./index.d.ts","module":"dist/index.js","gitHead":"19ffdba811f4c0dd9c3fd3e076ab9f71da12d91d","scripts":{"lint":"eslint --ext .js,.ts,.json, .","test":"npm run cypress:run","build":"tsc || echo 'built, with type errors'","watch":"tsc -w","check-ts":"tsc --noEmit","cypress:run":"node ../../scripts/cypress run --project . --component","cypress:open":"node ../../scripts/cypress open --project . --component"},"_npmUser":{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"},"repository":{"url":"git+https://github.com/cypress-io/cypress.git","type":"git"},"_npmVersion":"10.8.2","description":"Make ESM Modules mutable in the browser with Cypress and Vite","directories":{},"_nodeVersion":"18.17.1","dependencies":{"debug":"^4.3.4","picomatch":"2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"5.2.11","react":"16.8.6","react-dom":"16.8.6","react-router":"6.10.0","@types/picomatch":"2.3.0","react-router-dom":"6.10.0","@vitejs/plugin-react":"4.3.0","@tanstack/react-query":"4.36.1"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-cypress-esm_1.1.2_1733261405172_0.7041285385880174","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@cypress/vite-plugin-cypress-esm","version":"2.0.0","description":"Make ESM Modules mutable in the browser with Cypress and Vite","scripts":{"build":"tsc || echo 'built, with type errors'","check-ts":"tsc --noEmit","cypress:open":"node ../../scripts/cypress open --project . --component","cypress:run":"node ../../scripts/cypress run --project . --component","lint":"eslint --ext .js,.ts,.json, .","test":"npm run cypress:run","watch":"tsc -w"},"dependencies":{"debug":"^4.3.4","picomatch":"2.3.0"},"devDependencies":{"@tanstack/react-query":"4.36.1","@types/picomatch":"2.3.0","@vitejs/plugin-react":"4.6.0","react":"18.3.1","react-dom":"18.3.1","react-router":"6.28.0","react-router-dom":"6.28.0","vite":"^8.0.9"},"types":"dist/index.d.ts","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cypress-io/cypress.git"},"homepage":"https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm#readme","bugs":{"url":"https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm"},"type":"module","module":"dist/index.js","publishConfig":{"access":"public"},"nx":{"targets":{"build":{"outputs":["{projectRoot}/dist"]}}},"gitHead":"a462e8ad71384f72b15bc4211018d98f2c074c73","_id":"@cypress/vite-plugin-cypress-esm@2.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-M0Bs3CS+h+7DA12+iXQ/lvo+WD0O51alpqbILjBrKAPjKzj5vmqtGViqGATcppRoc0o6gW+FWX8j2tay7NVGDQ==","shasum":"293bef60bd0bafda2d8b2d7fba0c1cb645e10a7c","tarball":"https://registry.npmjs.org/@cypress/vite-plugin-cypress-esm/-/vite-plugin-cypress-esm-2.0.0.tgz","fileCount":5,"unpackedSize":26588,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDFRldqOlk3CNW/eKtiBnUbkCir4rm5LW1OVQ41QgzKmAIgFjEN5s4fyIwlARjWumU+RvpqtArmECnyDeANPVfJEJs="}]},"_npmUser":{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"},"directories":{},"maintainers":[{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vite-plugin-cypress-esm_2.0.0_1787786582310_0.0354826997690425"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-04T09:09:01.581Z","modified":"2026-08-26T23:23:02.612Z","1.0.0":"2023-05-04T09:09:01.744Z","1.0.1":"2023-05-23T19:49:15.626Z","1.1.0":"2023-08-07T06:49:47.696Z","1.1.1":"2024-05-10T18:20:35.266Z","1.1.2":"2024-12-03T21:30:05.354Z","2.0.0":"2026-08-26T23:23:02.445Z"},"bugs":{"url":"https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm"},"license":"MIT","homepage":"https://github.com/cypress-io/cypress/tree/develop/npm/vite-plugin-cypress-esm#readme","repository":{"type":"git","url":"git+https://github.com/cypress-io/cypress.git"},"description":"Make ESM Modules mutable in the browser with Cypress and Vite","maintainers":[{"name":"cypress-npm-publisher","email":"cypress-npm-publisher@cypress.io"}],"readme":"# @cypress/vite-plugin-cypress-esm\n\nA Vite plugin that intercepts and rewrites ES module imports within [Cypress component tests](https://docs.cypress.io/guides/component-testing/overview). The [ESM specification](https://tc39.es/ecma262/#sec-modules) generates modules that are \"sealed\", requiring the runtime (the browser) to prevent any alteration to the module namespace. While this has security and performance benefits, it prevents use of mocking libraries which would need to replace namespace members. This plugin wraps modules in a special [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) implementation, allowing for instrumentation by libraries such as Sinon.\n\n> **Note:** This package is a pre-release alpha and is not yet stable. There are likely to be bugs and edge cases. Please report any bugs [here](https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm). [Learn more about Cypress release stages](https://docs.cypress.io/guides/references/release-stages#Alpha) and expectations around stability.\n\n## Debugging\n\nRun Cypress with `DEBUG=cypress:vite-plugin-cypress-esm`. You will get logs in the terminal, for the code transformation, and in the browser console, for intercepting and wrapping the modules in a Proxy. \n## Compatibility\n\n| @cypress/vite-plugin-cypress-esm | cypress |\n| -------------------------------- | ------- |\n| >= v1                            | >= v12  |\n| >= v2 (ESM only module)          | >= v16  |\n\n## Usage\n\nThis plugin rewrites the ES modules served by Vite to make them mutable and therefore compatible with methods like [`cy.spy()`](https://docs.cypress.io/api/commands/spy) and [`cy.stub()`](https://docs.cypress.io/api/commands/stub) that require modifying otherwise-sealed objects. Since this is a testing-specific plugin it is recommended to apply it your Vite config only when running your Cypress tests. One way to do so would be in `cypress.config`:\n\n```ts\nimport { defineConfig } from 'cypress'\nimport viteConfig from './vite.config'\nimport { mergeConfig } from 'vite'\nimport { CypressEsm } from '@cypress/vite-plugin-cypress-esm'\n\nexport default defineConfig({\n  component: {\n    devServer: {\n      bundler: 'vite',\n      framework: 'react',\n      viteConfig: () => {\n        return mergeConfig(\n          viteConfig,\n          {\n            plugins: [\n              CypressEsm(),\n            ]\n          }\n        )\n      }\n    }\n  }\n})\n```\n\n### `ignoreModuleList`\n\nSome modules may be incompatible with Proxy-based implementation. The eventual goal is to support wrapping all modules in a Proxy to better facilitate testing. For now, if you run into any issues with a particular module, you can tell the plugin to skip it like so:\n\n```ts\nCypressEsm({\n  ignoreModuleList: ['react-router', 'react-router-dom']\n})\n```\n\nYou can also use a glob, which uses [`picomatch`](https://github.com/micromatch/picomatch) internally:\n\n```ts\nCypressEsm({\n  ignoreModuleList: ['*react*']\n})\n```\n\nThis will exclude modules matching the supplied pattern(s) from being processed by this plugin. It is important to note that the act of importing any matching module into other files/modules will still be processed unless those destinations are themselves excluded via the list, but those imports will receive the unaltered version.\n\nCertain third-party dependencies such as React are known to have some conflicts with the Proxy implementation that cause problems stubbing internal functionality. Since it is unlikely you want to stub parts of React itself, it's a good idea to add it to the `ignoreModuleList`.\n\n### `ignoreImportList`\n\nThere may be times when you want to use an unaltered dependency rather than the proxied version created by this plugin in a specific location, or want to use the standard import mechanism rather than the one provided by this plugin. This may be because:\n1. You have a test that needs to validate original/unaltered behavior\n2. You have a dependency (internal or external) that you wish to exclude from the processing done by this plugin. This is commonly due to third-party libraries that behave in a way that is unsupported.\n3. You have code that relies on auto-hoisting which breaks when this plugin restructures the code (see [Auto-hoisting](#auto-hoisting))\n\nTo instruct this plugin to skip a given import and use the unaltered target module use `ignoreImportList`. This also supports `picomatch` patterns.\n\n```ts\nCypressEsm({\n  ignoreImportList: ['**/internal/problematic-file.js']\n})\n```\n\nIf using the `@cypress/react` test harness, you may need to ignore the `react-dom/client` module by configuring as such:\n\n```ts\nCypressEsm({\n  ignoreImportList: ['**/react-dom/client']\n})\n```\n\n## Known Issues\n\n### Import Syntax\n\nAll known [import syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) is supported, however there may be edge cases that have not been identified.\n\n### Regular Expression matching\n\nThis module uses Regular Expression matching to transform the modules on the server to facilitate wrapping them in a `Proxy` on the client. In future updates, a more robust AST-based approach will be explored. A limitation of the current approach is that it does not recognize syntax from actual code vs content found within strings (for instance, an error string that contains example code syntax). This can result in inappropriately modified string constants.\n\n### Auto-hoisting\n\nESM imports are automatically hoisted to the top of a given module so they happen first before any code that references them. This plugin does not currently perform any hoisting, so imports are transformed to variable references in place. If you have code that attempts to reference an imported value prior to that import it will likely break. This is a known issue with HMR logic in Svelte projects, and will typically present as a \"use before define\" error.\n\n### Self-references and internal calls\n\nThis plugin works by intercepting calls coming *in* to a module. This will not work for situations where a module attempts to make *internal* calls to a function within the same module or directly compare against a function within the same module. Eg:\n\n```js\n// mod_1.js\nexport function foo () {\n  // ...\n}\n\nexport function bar (mod) {\n  return mod === foo \n}\n\n// mod_2.js\nimport { foo, bar } from './mod_1.js'\n\nbar(foo) //=> false\n```\n\nIn this example, `bar(foo)` is passing a reference to `mod_1.foo`, where `mod_1` is a module wrapped in a `Proxy`. In the original `mod_1.js`, the reference to `foo` is the original, unwrapped `foo`, so the comparison return `false`. This may cause issues in some libraries, such as React Router when lazy loading routes. You can add modules to `ignoreModuleList` to work around this issue.\n\n### Sinon compatibility\n\nThis plugin is designed to work with [Sinon](https://sinonjs.org/) since that is what Cypress uses internally for `cy.stub` and `cy.spy` - attempting to utilize other stubbing/mocking libraries or directly mutating modules is not a supported use case and will likely not work as expected.\n\n## Troubleshooting\n\nThis is an **_Alpha_** release, meaning there a very likely bugs in the implementation and it is expected that you will encounter issues. We appreciate any bug reports once you have performed the troubleshooting process below.\n\nIf you encounter issues:\n1. Ensure you're using the very latest version of this Plugin and Cypress\n2. Try temporarily removing this plugin from your test's Vite config - if the issue is still present then it is not related to this plugin.\n3. Verify you have not encountered one of the [Known Issues](#known-issues)\n3. If the issue disappeared then try narrowing down if it's related to a specific module/dependency by using the `ignoreModuleList` & `ignoreImportList` config\n4. If your problem isn't related to a specific dependency and can't be isolated please file a bug report [here](https://github.com/cypress-io/cypress/issues/new?labels=npm:%20@cypress/vite-plugin-cypress-esm). A reproduction case project is extremely helpful to track down specific issues, and capturing [Debug Logs](#debugging) from both your terminal *and* the browser devtools console is very helpful.\n\n## License\n\n[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cypress-io/cypress/blob/develop/LICENSE)\n\nThis project is licensed under the terms of the [MIT license](/LICENSE).\n\n## [Changelog](./CHANGELOG.md)\n","readmeFilename":"README.md"}