{"id":21068913,"url":"https://github.com/brandcom/silverstripe-vite","last_synced_at":"2025-05-16T03:33:42.409Z","repository":{"id":57036187,"uuid":"452223907","full_name":"brandcom/silverstripe-vite","owner":"brandcom","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-20T21:37:50.000Z","size":24,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-10T05:13:22.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brandcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-26T10:00:17.000Z","updated_at":"2024-02-09T05:31:15.000Z","dependencies_parsed_at":"2023-01-21T09:02:24.892Z","dependency_job_id":null,"html_url":"https://github.com/brandcom/silverstripe-vite","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandcom%2Fsilverstripe-vite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandcom%2Fsilverstripe-vite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandcom%2Fsilverstripe-vite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brandcom%2Fsilverstripe-vite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brandcom","download_url":"https://codeload.github.com/brandcom/silverstripe-vite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225405174,"owners_count":17469296,"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":[],"created_at":"2024-11-19T18:29:14.866Z","updated_at":"2024-11-19T18:29:15.596Z","avatar_url":"https://github.com/brandcom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Silverstripe Vite Plugin\n\n\n## Silverstripe Version support\n\n* `^0.x` supports Silverstripe 4.x\n* `dev-master` supports Silverstripe 5.x. Note: No stable release available yet, see https://github.com/brandcom/silverstripe-vite/issues/3 \n\n## Installation\n\n```\ncomposer require passchn/silverstripe-vite\n```\n\nIn your `mysite.yml`:\n\n```\nPage:\n  extensions:\n    - ViteHelper\\Vite\\ViteDataExtension\n```\n\n## Configuration\n\nYou can override the default config in your `mysite.yml`:\n\n```\nViteHelper\\Vite\\ViteHelper:\n  forceProductionMode: false\n  devHostNeedle: '.test'\n  devPort: 3000\n  jsSrcDirectory: 'public_src/'\n  mainJS: 'main.js'\n  manifestDir: '/public/manifest.json'\n```\n\n*ViteHelper Config setting options:*\n- If you set `forceProductionMode` to true, the build files (created after running `vite build`) will be served.\n- Set the `devHostNeedle` to distinguish your live site from your local environment, e.g `localhost:8080`, `mysite.test` or `127.0.0.1`. \n  - **Note:** The vite dev server must also be running. \n- Set the `devPort` to the port of the vite dev server, e.g. `3000` – the vite port will be shown in the terminal when running the dev server. To set a fixed port (recommended), remember to also set it in the [vite config](https://github.com/brandcom/silverstripe-vite/wiki/example-vite-config) - under `server`. The port in both configs must always match. \n- Define the `mainJS` entry point to where your applications script file is located.\n  - E.g., if you use TypeScript, change the `mainJs` prop to `\"main.ts\"`.\n- Define the `manifestDir` for where the manifest file will be located.\n\n## Usage\n\nInsert JS / CSS tags in your main template, e.g., `Page.ss`:\n\n```\n\u003chead\u003e\n    ...\n    $Vite.HeaderTags.RAW\n\u003c/head\u003e\n\u003cbody\u003e\n    ...\n    $Vite.BodyTags.RAW\n\u003c/body\u003e\n```\n\n## Vite config\n\nThe config must match the `vite.config.js`. You need to **?flush** after making changes to yml configs.\n\nTake a look at the [ViteHelper.php](https://github.com/passchn/silverstripe-vite/blob/master/src/Vite/ViteHelper.php) for more Information. \n\nThe config from your vite.config.js or vite.config.ts must match your ViteHelper config for this plugin.\n\nSee this [example vite.config.ts](https://github.com/brandcom/silverstripe-vite/wiki/example-vite-config) for default configuration. \n\n**Note:** When using vite below `2.9.0`, the server config will be different. [See this config](https://github.com/brandcom/silverstripe-vite/wiki/example-vite-config#vite-below-290).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandcom%2Fsilverstripe-vite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrandcom%2Fsilverstripe-vite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandcom%2Fsilverstripe-vite/lists"}