{"_id":"@capgo/vite-capacitor","_rev":"3-fdd172d3b611f49ea4f444b6ac51f8dd","name":"@capgo/vite-capacitor","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@capgo/vite-capacitor","version":"0.1.0","keywords":["capacitor","plugin","vite","dev server","automation"],"author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"license":"MIT","_id":"@capgo/vite-capacitor@0.1.0","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"}],"homepage":"https://github.com/Cap-go/vite-capacitor#readme","bugs":{"url":"https://github.com/Cap-go/vite-capacitor/issues"},"dist":{"shasum":"b4a840d4ee6d297cb0d2490b5834893ba3255d94","tarball":"https://registry.npmjs.org/@capgo/vite-capacitor/-/vite-capacitor-0.1.0.tgz","fileCount":11,"integrity":"sha512-ai0q8NgV3zQfLcnttjPhQjOKL6XV69ZLPOggl3mnhxfn0Fl6SQRswrzCG7EHCTK1h7dQV6+Xs4M3luhkVKFEWQ==","signatures":[{"sig":"MEQCIEASO5Hl0ROhgCN4R0e3HEz/e5F/V/VTQ554ZQIoJxqNAiBal4CoveQ/7S2GTrK6drs4UJNshtP34o8ZG8pY2sVTGg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67873},"main":"dist/index.cjs","type":"module","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","gitHead":"56757dd26b6c3702b30486a8b9b64dbd6489587a","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write","lint":"npm run eslint && npm run prettier -- --check","build":"npm run clean && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","eslint":"eslint . --ext .ts","verify":"npm run lint && npm run build","prettier":"prettier \"**/*.{ts,js,json}\"","prepublishOnly":"npm run build"},"_npmUser":{"name":"riderx","email":"martin.donadieu@hey.com"},"repository":{"url":"git+https://github.com/Cap-go/vite-capacitor.git","type":"git"},"_npmVersion":"11.6.0","description":"Vite plugin that keeps native Capacitor platform configs in sync with the dev server URL.","directories":{},"_nodeVersion":"24.8.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.2.0","eslint":"^9.11.1","rimraf":"^6.0.1","rollup":"^4.34.6","prettier":"^3.4.2","typescript":"^5.7.3","@types/node":"^22.13.1","@typescript-eslint/parser":"^8.16.0","@typescript-eslint/eslint-plugin":"^8.16.0"},"peerDependencies":{"vite":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-capacitor_0.1.0_1760597574309_0.38250639051117963","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@capgo/vite-capacitor","version":"0.1.1","keywords":["capacitor","plugin","vite","dev server","automation"],"author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"license":"MIT","_id":"@capgo/vite-capacitor@0.1.1","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"}],"homepage":"https://github.com/Cap-go/vite-capacitor#readme","bugs":{"url":"https://github.com/Cap-go/vite-capacitor/issues"},"dist":{"shasum":"4ee3ff9999019c09a8cc9dcc371ef1a3a77b3033","tarball":"https://registry.npmjs.org/@capgo/vite-capacitor/-/vite-capacitor-0.1.1.tgz","fileCount":11,"integrity":"sha512-G+R1RUsk3okwXsLyScaAXOu5y5IL/9JezFEekcA6WheTFykz46yCzhWpsXoUnH1dl57iVDgFbhf3/9hTd/6PEg==","signatures":[{"sig":"MEUCIHNH1yxXLROY434sHoAhvoWUGlWfptjgcZb49lDnOAv/AiEAqay0wiXCwjTUYI0m8xa1bt/3OJJAf9NmGy4VY8CUe0E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capgo%2fvite-capacitor@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":84345},"main":"dist/index.cjs","type":"module","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","gitHead":"fe22dac92e2d24ccb610d9ba08ffeee1441268fb","scripts":{"fmt":"bun run eslint -- --fix && bun run prettier -- --write","lint":"bun run eslint && bun run prettier -- --check","test":"bun run verify","build":"bun run clean && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","eslint":"eslint . --ext .ts","verify":"bun run lint && bun run build","prettier":"prettier \"**/*.{ts,js,json}\"","prepublishOnly":"bun run build"},"_npmUser":{"name":"riderx","email":"martin.donadieu@hey.com"},"repository":{"url":"git+https://github.com/Cap-go/vite-capacitor.git","type":"git"},"_npmVersion":"11.12.1","description":"Vite plugin that keeps native Capacitor platform configs in sync with the dev server URL.","directories":{},"_nodeVersion":"24.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.2.0","eslint":"^9.11.1","rimraf":"^6.0.1","rollup":"^4.34.6","prettier":"^3.4.2","typescript":"^5.7.3","@types/node":"^24","@typescript-eslint/parser":"^8.16.0","@typescript-eslint/eslint-plugin":"^8.16.0"},"peerDependencies":{"vite":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-capacitor_0.1.1_1778941234839_0.422829709987417","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-10-16T06:52:54.196Z","modified":"2026-08-19T10:41:35.103Z","0.1.0":"2025-10-16T06:52:54.477Z","0.1.1":"2026-05-16T14:20:34.978Z"},"bugs":{"url":"https://github.com/Cap-go/vite-capacitor/issues"},"author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"license":"MIT","homepage":"https://github.com/Cap-go/vite-capacitor#readme","keywords":["capacitor","plugin","vite","dev server","automation"],"repository":{"url":"git+https://github.com/Cap-go/vite-capacitor.git","type":"git"},"description":"Vite plugin that keeps native Capacitor platform configs in sync with the dev server URL.","maintainers":[{"email":"martin.donadieu@hey.com","name":"riderx"},{"email":"tori@capgo.app","name":"torichancapgo"}],"readme":"# @capgo/vite-capacitor\n\n<a href=\"https://capgo.app/\"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>\n\n<div align=\"center\">\n  <h2><a href=\"https://capgo.app/?ref=plugin_vite_capacitor\"> ➡️ Get Instant updates for your App with Capgo</a></h2>\n  <h2><a href=\"https://capgo.app/consulting/?ref=plugin_vite_capacitor\"> Missing a feature? We’ll build the plugin for you 💪</a></h2>\n</div>\n\nCapacitor copies `capacitor.config.json` into each native platform. During development you usually want the dev server URL injected so the native apps talk to Vite. This Vite plugin keeps those files in sync with the dev server lifecycle: when the server starts the URL is written, when it stops the files are restored.\n\n## Install\n\n```bash\nnpm install @capgo/vite-capacitor --save-dev\n```\n\n## Usage\n\nAdd the plugin to `vite.config.ts`:\n\n```ts\nimport { defineConfig } from \"vite\";\nimport viteCapacitor from \"@capgo/vite-capacitor\";\n\nexport default defineConfig({\n  plugins: [\n    viteCapacitor({\n      platforms: [\"ios\", \"android\"],\n    }),\n  ],\n});\n```\n\nStart Vite as usual:\n\n```bash\nnpm run dev\n```\n\nThe plugin will:\n\n- detect the dev server URL once Vite is listening (respecting HTTPS and custom host/port),\n- write the URL and `cleartext` flag to the native copies at `ios/App/App/capacitor.config.json` and `android/app/src/main/assets/capacitor.config.json` (if they exist),\n- skip untouched files that are missing or unchanged,\n- restore the original files when Vite shuts down or the process exits.\n\nFor physical iOS or Android devices, expose Vite on the network and opt into a LAN URL:\n\n```ts\nviteCapacitor({\n  platforms: [\"ios\", \"android\"],\n  cleartext: true,\n  networkUrl: true,\n});\n```\n\n```bash\nnpm run dev -- --host 0.0.0.0\n```\n\nWhen `networkUrl` is enabled and Vite listens on `0.0.0.0`, `::`, or `server.host === true`, the plugin writes `http://<local-lan-ip>:<port>` instead of `localhost`. To choose a specific interface, set `CAP_SERVER_HOST` or pass `networkUrl: { host: \"192.168.1.23\" }`.\n\n## Options\n\n```ts\nviteCapacitor({\n  root?: string; // defaults to Vite's resolved root\n  platforms?: Array<\"ios\" | \"android\">; // defaults to both\n  iosConfigPath?: string; // default: 'ios/App/App/capacitor.config.json'\n  androidConfigPath?: string; // default: 'android/app/src/main/assets/capacitor.config.json'\n  additionalConfigPaths?: string[]; // extra files to keep in sync\n  cleartext?: boolean; // defaults to true\n  logLevel?: \"silent\" | \"info\" | \"debug\";\n  urlOverride?: string | ((context) => string); // force a specific URL instead of auto-detecting\n  networkUrl?: boolean | { host?: string }; // use a LAN host for wildcard Vite hosts\n});\n```\n\nThe shared `capacitor.config.json` at the project root is never touched. Only files that already exist on disk are modified. If you customise Capacitor's output paths you can point the plugin at your copies via `additionalConfigPaths`.\n\n---\n\nBuilt with ❤️ by the Capgo team. Need help? [Let’s talk](https://capgo.app/consulting/?ref=plugin).\n","readmeFilename":"README.md"}