{"id":18412348,"url":"https://github.com/vc-z/vite-plugin-multip","last_synced_at":"2025-04-07T11:31:56.217Z","repository":{"id":228762586,"uuid":"772128403","full_name":"vc-z/vite-plugin-multip","owner":"vc-z","description":"Create powerful multi-page applications with Vite","archived":false,"fork":false,"pushed_at":"2024-08-03T15:56:59.000Z","size":401,"stargazers_count":9,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T12:14:56.931Z","etag":null,"topics":["mpa","plugin","typescript","vite"],"latest_commit_sha":null,"homepage":"https://npmjs.com/vite-plugin-multip","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vc-z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-14T15:33:38.000Z","updated_at":"2024-08-03T15:47:18.000Z","dependencies_parsed_at":"2024-03-28T13:50:47.827Z","dependency_job_id":"fe0a813b-ded5-4773-a46a-0a1fbb728e4a","html_url":"https://github.com/vc-z/vite-plugin-multip","commit_stats":null,"previous_names":["vclemenzi/vite-plugin-multip","vc-z/vite-plugin-multip"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-z%2Fvite-plugin-multip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-z%2Fvite-plugin-multip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-z%2Fvite-plugin-multip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc-z%2Fvite-plugin-multip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vc-z","download_url":"https://codeload.github.com/vc-z/vite-plugin-multip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247644331,"owners_count":20972267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mpa","plugin","typescript","vite"],"created_at":"2024-11-06T03:41:11.669Z","updated_at":"2025-04-07T11:31:54.985Z","avatar_url":"https://github.com/vc-z.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-multip\n\n[![npm version](https://img.shields.io/npm/v/vite-plugin-multip)](https://npmjs.com/package/vite-plugin-multip)\n[![weekly downloads](https://img.shields.io/npm/dw/vite-plugin-multip)](https://npmjs.com/package/vite-plugin-multip)\n[![license](https://img.shields.io/npm/l/vite-plugin-multip)](https://github.com/vclemenzi/vite-plugin-multip/blob/main/LICENSE)\n\nThe `vite-plugin-multip` plugin enables you to create multi-page applications with Vite!\n\n- 📦 Automatic CSS file importing\n- 🧬 Layouts support\n- 🔎 Framework recognition\n- 📝 Markdown support\n- 🥏 Multi-Framework support\n\n# Installation\n\n```bash\nnpm install vite-plugin-multip\n```\n\n_Alternatively, you can use your favorite package manager._\n\nAfter installing the plugin, proceed with initialization in the `vite.config.ts` file:\n\n```typescript\nimport { defineConfig } from \"vite\";\nimport { svelte } from \"@sveltejs/vite-plugin-svelte\";\nimport { multip } from \"vite-plugin-multip\";\n\nexport default defineConfig({\n  plugins: [\n    svelte(),\n    multip(), // Optional configuration parameters can be passed here\n  ],\n});\n```\n\n\u003e [!NOTE]\n\u003e In the above example, the Svelte adapter is used, but the plugin also automatically supports Vue and React.\n\nNow, let's start by creating the appropriate directories:\n\n```bash\nsrc/\n  pages/\n    index.(svelte|tsx|vue)\n    subroute/\n       index.(svelte|tsx|vue)\n```\n\nRemove imports in `index.html` (required):\n\n```diff\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\" /\u003e\n  \u003clink rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" /\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n  \u003ctitle\u003eVite + Svelte + TS\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n+ \u003cslot /\u003e\n- \u003cdiv id=\"app\"\u003e\u003c/div\u003e\n- \u003cscript type=\"module\" src=\"/src/main.ts\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n_index.html works as a layout_\n\nNow, build:\n\n```bash\nnpm run build\n```\n\n\u003e [!NOTE]\n\u003e The `dist/` directory can be directly integrated with your backend without modification.\n\n# Configuration\n\nConfiguration parameters\n\n```ts\n// plugins: [multip(...config)]\ntype Config = {\n  directory?: string;\n  page?: Page;\n  minify?: import(\"html-minifier-terser\").Options;\n  assets?: import(\"rollup-plugin-copy\").Target[];\n};\n\ntype Page = {\n  title?: string | ((file: string) =\u003e string);\n};\n```\n\n# Framework Support\n\n| Framework | Support |\n| --------- | ------- |\n| React     | Yes     |\n| Vue       | Yes     |\n| Svelte    | Yes     |\n| Solid     | Yes     |\n| Qwik      | No      |\n| Lit       | No      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvc-z%2Fvite-plugin-multip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvc-z%2Fvite-plugin-multip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvc-z%2Fvite-plugin-multip/lists"}