{"_id":"vite-plugin-wrapper","_rev":"4-4eb88959c8f00316bc403083a7e2e34b","name":"vite-plugin-wrapper","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.1":{"name":"vite-plugin-wrapper","version":"0.0.1","license":"MIT","_id":"vite-plugin-wrapper@0.0.1","maintainers":[{"name":"magne4000","email":"joel.charles91@gmail.com"}],"homepage":"https://github.com/magne4000/vite-plugin-wrapper#readme","bugs":{"url":"https://github.com/magne4000/vite-plugin-wrapper/issues"},"dist":{"shasum":"b91db1f861d8c29a783886842630f62dd2036e48","tarball":"https://registry.npmjs.org/vite-plugin-wrapper/-/vite-plugin-wrapper-0.0.1.tgz","fileCount":3,"integrity":"sha512-EwrNWcsRnt7RY6uA7uJpYqrEVgLW5FAATun2l6BoCDesut8SHZ1YHTypb6m3B59ql0DuHrlxWm7RBxk9xaOeBQ==","signatures":[{"sig":"MEUCIEyTuZDE6t9F+2C3i9flydKEbsyIlA70ECgLGe1zzXIMAiEApOhbQq1GyQfe2w6KXu3noKFtwcKa8CbytWYWy1DsrWg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2859},"main":"./dist/index.js","type":"module","_from":"file:vite-plugin-wrapper-0.0.1.tgz","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","test:types":"tsc --noEmit"},"_npmUser":{"name":"magne4000","email":"joel.charles91@gmail.com"},"_resolved":"/tmp/061e6b20dfbd99592a88ace30db2a8d6/vite-plugin-wrapper-0.0.1.tgz","_integrity":"sha512-EwrNWcsRnt7RY6uA7uJpYqrEVgLW5FAATun2l6BoCDesut8SHZ1YHTypb6m3B59ql0DuHrlxWm7RBxk9xaOeBQ==","repository":{"url":"git+https://github.com/magne4000/vite-plugin-wrapper.git","type":"git"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.0","tsdown":"^0.20.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^22.19.3","@biomejs/biome":"^2.3.9","@vikejs/biome-config":"^2.0.1"},"peerDependencies":{"vite":"^7.3.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-wrapper_0.0.1_1770142133018_0.7492642472646975","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"vite-plugin-wrapper","version":"0.0.2","license":"MIT","_id":"vite-plugin-wrapper@0.0.2","maintainers":[{"name":"magne4000","email":"joel.charles91@gmail.com"}],"homepage":"https://github.com/magne4000/vite-plugin-wrapper#readme","bugs":{"url":"https://github.com/magne4000/vite-plugin-wrapper/issues"},"dist":{"shasum":"933849f9d6999fdbf5b3b9d17d5782d5b2935a35","tarball":"https://registry.npmjs.org/vite-plugin-wrapper/-/vite-plugin-wrapper-0.0.2.tgz","fileCount":3,"integrity":"sha512-Sqvcos4EJHFAf0LCKxDzVwe35JFRVu8DPh4TOD9iogbFhCZeNyIVoDI5KYWbnRvhAfOT2VER5P1hOQewC4Z4qw==","signatures":[{"sig":"MEYCIQC849gHcHnMVNTRnURSuWBH9NKaBDbVjFYt12pxxAlA+AIhAIq2h4OGtrLHyi1YVTgV+EDJpnKJOakuPbiA7of7//ih","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2875},"main":"./dist/index.js","type":"module","_from":"file:vite-plugin-wrapper-0.0.2.tgz","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","test:types":"tsc --noEmit"},"_npmUser":{"name":"magne4000","email":"joel.charles91@gmail.com"},"_resolved":"/tmp/da10b1d9687d873ece19add6df9be47c/vite-plugin-wrapper-0.0.2.tgz","_integrity":"sha512-Sqvcos4EJHFAf0LCKxDzVwe35JFRVu8DPh4TOD9iogbFhCZeNyIVoDI5KYWbnRvhAfOT2VER5P1hOQewC4Z4qw==","repository":{"url":"git+https://github.com/magne4000/vite-plugin-wrapper.git","type":"git"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.0","tsdown":"^0.20.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^22.19.3","@biomejs/biome":"^2.3.9","@vikejs/biome-config":"^2.0.1"},"peerDependencies":{"vite":"^7.3.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-wrapper_0.0.2_1770820586528_0.7270141549417599","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"vite-plugin-wrapper","version":"0.1.0","keywords":["vite","vite-plugin","wrapper","module-wrapper","virtual-module","rollup","bundler","esm"],"author":{"name":"Joël Charles","email":"joel.charles91@gmail.com"},"license":"MIT","_id":"vite-plugin-wrapper@0.1.0","maintainers":[{"name":"magne4000","email":"joel.charles91@gmail.com"}],"homepage":"https://github.com/magne4000/vite-plugin-wrapper#readme","bugs":{"url":"https://github.com/magne4000/vite-plugin-wrapper/issues"},"dist":{"shasum":"03d4069f3d246e4580fe2f2aa91db660be4d6dd4","tarball":"https://registry.npmjs.org/vite-plugin-wrapper/-/vite-plugin-wrapper-0.1.0.tgz","fileCount":4,"integrity":"sha512-orELI9PzoYKFRsI8TP4pTt05rL0oS68u8kJSANpJLZWdYdkqEsjEPrTLG1U/7x5PlACxIebmkbiBPaCg/oPSsw==","signatures":[{"sig":"MEUCIGgfoeOjaSVna1G+AsszSgzb6sRB+XRztYESoKx/Zo92AiEA8kDG3XYYdjWqPFCgfGM+JS/Ont9g9NVAKrCzlN17qSY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5074},"main":"./dist/index.js","type":"module","_from":"file:vite-plugin-wrapper-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","format":"biome check --fix","test:types":"tsc --noEmit"},"_npmUser":{"name":"magne4000","email":"joel.charles91@gmail.com"},"_resolved":"/tmp/ed8b4a9d76a19447596d88407c464c65/vite-plugin-wrapper-0.1.0.tgz","_integrity":"sha512-orELI9PzoYKFRsI8TP4pTt05rL0oS68u8kJSANpJLZWdYdkqEsjEPrTLG1U/7x5PlACxIebmkbiBPaCg/oPSsw==","repository":{"url":"git+https://github.com/magne4000/vite-plugin-wrapper.git","type":"git"},"_npmVersion":"11.6.2","description":"A Vite plugin for transparently wrapping matched modules with custom implementations.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.0","tsdown":"^0.20.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^22.19.3","@biomejs/biome":"^2.3.9","@vikejs/biome-config":"^2.0.1"},"peerDependencies":{"vite":">=7"},"_npmOperationalInternal":{"tmp":"tmp/vite-plugin-wrapper_0.1.0_1770909976618_0.5639291609134163","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"vite-plugin-wrapper","version":"0.1.1","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"devDependencies":{"@biomejs/biome":"^2.3.9","@types/node":"^22.19.3","@vikejs/biome-config":"^2.0.1","tsdown":"^0.20.1","typescript":"^5.9.3","vite":"^7.3.0","vitest":"^4.0.18"},"peerDependencies":{"vite":">=7"},"author":{"name":"Joël Charles","email":"joel.charles91@gmail.com"},"description":"A Vite plugin for transparently wrapping matched modules with custom implementations.","keywords":["vite","vite-plugin","wrapper","module-wrapper","virtual-module","rollup","bundler","esm"],"repository":{"type":"git","url":"git+https://github.com/magne4000/vite-plugin-wrapper.git"},"sideEffects":false,"license":"MIT","scripts":{"dev":"tsdown --watch","build":"tsdown","test":"vitest run","format":"biome check --fix","test:types":"tsc --noEmit"},"_id":"vite-plugin-wrapper@0.1.1","bugs":{"url":"https://github.com/magne4000/vite-plugin-wrapper/issues"},"homepage":"https://github.com/magne4000/vite-plugin-wrapper#readme","_integrity":"sha512-hbY5eLvv9YZ+SWLJ6wQRunzDCSiN59WuzBgYlhbiQSD2seDiUfmfuaSGBS07oPpA5+RAX2oDV2BGyusfKNcZcQ==","_resolved":"/tmp/20fbbdd5dab6e93b05e918fb161520f6/vite-plugin-wrapper-0.1.1.tgz","_from":"file:vite-plugin-wrapper-0.1.1.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-hbY5eLvv9YZ+SWLJ6wQRunzDCSiN59WuzBgYlhbiQSD2seDiUfmfuaSGBS07oPpA5+RAX2oDV2BGyusfKNcZcQ==","shasum":"86397314f45374c8523100f979d5d42f9327c588","tarball":"https://registry.npmjs.org/vite-plugin-wrapper/-/vite-plugin-wrapper-0.1.1.tgz","fileCount":4,"unpackedSize":5075,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC0ojfRCLQvACZansUPAHHp3I/xYrdY/Scs781c+rbMMgIgU06YSZ0s+8eEcSb+PSWqSR6cEHrwme6KadeUhHhq68s="}]},"_npmUser":{"name":"magne4000","email":"joel.charles91@gmail.com"},"directories":{},"maintainers":[{"name":"magne4000","email":"joel.charles91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vite-plugin-wrapper_0.1.1_1784586934044_0.9375205794840502"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-03T18:08:52.957Z","modified":"2026-07-20T22:35:34.367Z","0.0.1":"2026-02-03T18:08:53.166Z","0.0.2":"2026-02-11T14:36:26.663Z","0.1.0":"2026-02-12T15:26:16.753Z","0.1.1":"2026-07-20T22:35:34.247Z"},"bugs":{"url":"https://github.com/magne4000/vite-plugin-wrapper/issues"},"author":{"name":"Joël Charles","email":"joel.charles91@gmail.com"},"license":"MIT","homepage":"https://github.com/magne4000/vite-plugin-wrapper#readme","keywords":["vite","vite-plugin","wrapper","module-wrapper","virtual-module","rollup","bundler","esm"],"repository":{"type":"git","url":"git+https://github.com/magne4000/vite-plugin-wrapper.git"},"description":"A Vite plugin for transparently wrapping matched modules with custom implementations.","maintainers":[{"name":"magne4000","email":"joel.charles91@gmail.com"}],"readme":"# vite-plugin-wrapper\n\nWrap existing modules in Vite.\n\n`vite-plugin-wrapper` lets you transparently replace matched modules with a custom wrapper implementation,\nwhile still resolving the original module underneath.\n\nIt is designed for building higher-level Vite plugins and virtual module systems.\n\n---\n\n## Installation\n\n```bash\nnpm install vite-plugin-wrapper\n```\n\n---\n\n## Usage\n\n```ts\nimport { defineConfig } from \"vite\";\nimport { wrapper } from \"vite-plugin-wrapper\";\n\nexport default defineConfig({\n  plugins: [\n    wrapper({\n      resolveId: {\n        filter: {\n          id: /^virtual:bar$/,\n        },\n      },\n\n      // Here, `id` is the original module that we are wrapping\n      load(id) {\n        return `\nimport mod from ${JSON.stringify(id)};\nexport default { ...mod, foo: 'foo' };\n`;\n      },\n    }),\n  ],\n});\n```\n\nNow `virtual:bar` will be wrapped with your custom module logic.\n\n---\n\n## What It Does\n\nFor every matched module:\n\n- Resolves the module normally\n- Replaces its implementation with your `load()` result\n- Keeps resolution behavior intact\n\nFrom the consumer’s perspective, the module simply behaves as your wrapped version.\n\n---\n\n## API\n\n### Options\n\n#### `resolveId.filter`\n\nDefines which modules should be wrapped.\n\nYou can use:\n\n**RegExp**\n\n```ts\n{ id: /\\.tsx$/ }\n````\n\n**Include / Exclude**\n\n```ts\n{\n  id: {\n    include: /\\.tsx$/,\n    exclude: /node_modules/\n  }\n}\n```\n\n**Function**\n\n```ts\n(id, importer) => id.startsWith(\"virtual:\")\n```\n\n---\n\n#### `load(id)`\n\nDefines the wrapped module implementation.\n\n* Receives the resolved module id\n* Must return the new module source code\n* Can import the original module using the provided `id`\n\nExample:\n\n```ts\nload(id) {\n  return `\nimport original from ${JSON.stringify(id)};\nexport default { ...original, extra: true };\n`;\n}\n```\n\n\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}