{"id":14987223,"url":"https://github.com/fab-it-hub/vite-plugin-ci4","last_synced_at":"2025-04-11T23:23:19.333Z","repository":{"id":215921220,"uuid":"739950902","full_name":"fab-it-hub/vite-plugin-ci4","owner":"fab-it-hub","description":"Vite Plugin for CodeIgniter 4 integration.","archived":false,"fork":false,"pushed_at":"2024-06-14T06:52:45.000Z","size":215,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-25T19:14:41.960Z","etag":null,"topics":["bun","ci4","codeigniter","codeigniter-4","codeigniter4","plugin","typescript","vite","vite-plugin","vite-plugin-ci4","vite-plugin-codeigniter","vitejs","vitejs-react"],"latest_commit_sha":null,"homepage":"","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/fab-it-hub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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-01-07T03:28:28.000Z","updated_at":"2024-07-28T14:53:45.000Z","dependencies_parsed_at":"2024-02-09T17:31:22.978Z","dependency_job_id":"4b0694d8-85d4-4a46-9326-e3573d11c632","html_url":"https://github.com/fab-it-hub/vite-plugin-ci4","commit_stats":{"total_commits":69,"total_committers":2,"mean_commits":34.5,"dds":0.2028985507246377,"last_synced_commit":"1e98fe909b7657d112d5abca2d7e19273bb98117"},"previous_names":["fab-it-hub/vite-plugin-ci4"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab-it-hub%2Fvite-plugin-ci4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab-it-hub%2Fvite-plugin-ci4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab-it-hub%2Fvite-plugin-ci4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fab-it-hub%2Fvite-plugin-ci4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fab-it-hub","download_url":"https://codeload.github.com/fab-it-hub/vite-plugin-ci4/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493504,"owners_count":21113273,"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":["bun","ci4","codeigniter","codeigniter-4","codeigniter4","plugin","typescript","vite","vite-plugin","vite-plugin-ci4","vite-plugin-codeigniter","vitejs","vitejs-react"],"created_at":"2024-09-24T14:14:16.668Z","updated_at":"2025-04-11T23:23:19.314Z","avatar_url":"https://github.com/fab-it-hub.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @fabithub/vite-plugin-ci4\n\n\u003e Vite Plugin for CodeIgniter 4 integration. Inspired by Laravel's Vite Plugin.\n\n\n[![fab-it-hub - vite-plugin-ci4](https://img.shields.io/badge/%40fab--it--hub-vite_plugin_ci4-blue?style=for-the-badge\u0026logo=github)](https://github.com/fab-it-hub/vite-plugin-ci4 \"Go to GitHub repo\")\n![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/fab-it-hub/vite-plugin-ci4?style=for-the-badge\u0026logo=github)\n[![GitHub Repo stars](https://img.shields.io/github/stars/fab-it-hub/vite-plugin-ci4?style=for-the-badge\u0026logo=github)](https://github.com/fab-it-hub/vite-plugin-ci4)\n[![GitHub forks](https://img.shields.io/github/forks/fab-it-hub/vite-plugin-ci4?style=for-the-badge\u0026logo=github\u0026color=pink)](https://github.com/fab-it-hub/vite-plugin-ci4)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/fab-it-hub/vite-plugin-ci4/tests.yml?style=for-the-badge\u0026logo=github%20actions)](https://github.com/fab-it-hub/vite-plugin-ci4/actions/workflows/tests.yml)\n[![GitHub Release](https://img.shields.io/github/v/release/fab-it-hub/vite-plugin-ci4?sort=date\u0026display_name=release\u0026style=for-the-badge)](https://www.npmjs.com/package/@fabithub/vite-plugin-ci4)\n[![NPM Downloads](https://img.shields.io/npm/dy/%40fabithub%2Fvite-plugin-ci4?style=for-the-badge\u0026logo=npm)](https://www.npmjs.com/package/@fabithub/vite-plugin-ci4)![Static Badge](https://img.shields.io/badge/made_with_Bun-bun?style=for-the-badge\u0026logo=bun\u0026logoColor=%23fbf0df\u0026color=%23000)\n![GitHub License](https://img.shields.io/github/license/fab-it-hub/vite-plugin-ci4?style=for-the-badge\u0026logo=github)\n\n\n## Introduction\n\nThis Vite plugin allows seamless integration of [Vite JS](https://vitejs.dev/) with [CodeIgniter 4](https://codeigniter.com/), providing enhanced development and build processes for your web applications.\n\n## Features\n\n- CodeIgniter 4 support for Vite.\n- Streamlined development workflow.\n- Efficient production builds.\n\n## Installation\n\n### NPM\n\n```bash\nnpm install --save-dev @fabithub/vite-plugin-ci4\n```\n\n### Yarn\n\n```bash\nyarn add --dev @fabithub/vite-plugin-ci4\n```\n\n### PNPM\n\n```bash\npnpm add -D @fabithub/vite-plugin-ci4\n```\n\n### Bun\n\n```bash\nbun add -d @fabithub/vite-plugin-ci4\n```\n\n## Usage\n\nIn your Vite configuration file (usually `vite.config.js`), add the plugin:\n\n```javascript\n// vite.config.js\nimport Ci4Plugin from \"@fabithub/vite-plugin-ci4\";\n\nexport default {\n  plugins: [Ci4Plugin(\"resources/index.js\")]\n};\n```\n\n## Configuration\n\n### Vite Config\n\nYou can customize the plugin by passing options during initialization:\n\n```javascript\n// vite.config.js\nimport Ci4Plugin from \"@fabithub/vite-plugin-ci4\";\n\nexport default {\n  plugins: [\n    Ci4Plugin({\n      input: [\"resources/index.js\", \"resources/app.css\"],\n      refresh: true\n      /* other configuration here */\n    })\n  ]\n};\n```\n\n### Git Ignore\n\nThe `hot` file is created and deleted when the vite dev server is run, making it safe to ignore it. You can change the `hot` file path by update the config `hotFile` by default it's `public/hot` and add the path in the `.gitignore`.\n\n```dockerfile\n# @fabithub/vite-plugin-ci4\npublic/hot\n```\n\n## Options\n\n| Configuration        | Type                                                          | Default                    | Description                                                                                                                                       |\n| -------------------- | ------------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `input`              | string / string[]                                             |                            | The path or paths of the entry points to compile.                                                                                                 |\n| `publicDirectory`    | string                                                        | \"public\"                   | Project's public directory.                                                                                                                       |\n| `buildDirectory`     | string                                                        | \"build\"                    | The public subdirectory where compiled assets should be written.                                                                                  |\n| `hotFile`            | string                                                        | \\`${publicDirectory}/hot\\` | The path to the \"hot\" file.                                                                                                                       |\n| `ssr`                | string / string[]                                             |                            | The path of the SSR entry point.                                                                                                                  |\n| `ssrOutputDirectory` | string                                                        | \"writable/ssr\"             | The directory where the SSR bundle should be written.                                                                                             |\n| `refresh`            | boolean / string / string[] / RefreshConfig / RefreshConfig[] | false                      | Configuration for performing full page refresh on blade (or other) file changes. [see more](https://github.com/ElMassimo/vite-plugin-full-reload) |\n| `transformOnServe`   | (code: string, url: string)=\u003estring                           |                            | Transform the code while serving.                                                                                                                 |\n\n## Example\n\n```typescript\n// vite.config.ts\nimport type { UserConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\nimport ci4 from \"@fabithub/vite-plugin-ci4\";\nimport { defineConfig, loadEnv } from \"vite\";\n\nexport default defineConfig(({ mode }): UserConfig =\u003e {\n  const env = loadEnv(mode, process.cwd());\n\n  return {\n    plugins: [react(), ci4(`${env.VITE_RESOURCES_DIR}/${env.VITE_ENTRY_FILE}`)]\n  };\n});\n```\n\n## TODO\n\n- [x] Basic Tests.\n- [ ] Better Documentation.\n- [ ] Tests for all files \u0026 functions.\n- [ ] Many More.\n\n## Credits\n\nThis plugin is inspired by [Laravel's vite-plugin](https://github.com/laravel/vite-plugin) by [Laravel](https://laravel.com/).\n\n## License\n\nReleased under [MIT](/LICENSE.md) by [@fab-it-hub](https://github.com/fab-it-hub).\n\n\u003e This project was created using `bun init` in bun v1.0.25. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffab-it-hub%2Fvite-plugin-ci4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffab-it-hub%2Fvite-plugin-ci4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffab-it-hub%2Fvite-plugin-ci4/lists"}