{"id":15971325,"url":"https://github.com/danielholmes/jimp-vite","last_synced_at":"2025-04-04T15:44:39.889Z","repository":{"id":145825458,"uuid":"567904319","full_name":"danielholmes/jimp-vite","owner":"danielholmes","description":"Try and get JIMP working with Vite (note, website shows console error, not working)","archived":false,"fork":false,"pushed_at":"2023-02-06T02:13:14.000Z","size":777,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T01:41:22.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://danielholmes.github.io/jimp-vite/","language":"TypeScript","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/danielholmes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-18T21:34:14.000Z","updated_at":"2024-02-27T05:30:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"69c631b4-680d-41e8-a089-8b14455c3d23","html_url":"https://github.com/danielholmes/jimp-vite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fjimp-vite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fjimp-vite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fjimp-vite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielholmes%2Fjimp-vite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielholmes","download_url":"https://codeload.github.com/danielholmes/jimp-vite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208063,"owners_count":20901568,"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-10-07T20:21:00.618Z","updated_at":"2025-04-04T15:44:39.865Z","avatar_url":"https://github.com/danielholmes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jimp on Vite\n\n[![Deploy](https://github.com/danielholmes/jimp-vite/actions/workflows/deploy.yml/badge.svg)](https://github.com/danielholmes/jimp-vite/actions/workflows/deploy.yml)\n\nExperiment to try and get JIMP working with Vite.\n\n## Setting up Development\n\nInstall required system dependencies using [ASDF](https://asdf-vm.com/):\n\n```bash\nasdf install\n```\n\nor manually install them, see `./.tool-versions`.\n\nInstall dependencies:\n\n```bash\nnpm ci\n```\n\nApply jimp patches:\n\n```bash\nnpx patch-package\n```\n\n## Running locally\n\n```bash\nnpm run dev\n```\n\n## Current status\n\nIt's working for loading in a jpeg jimp file with no plugins.\n\nSteps to get this working:\n\n 1. Use a custom packaging of jimp to strip all features except jpeg parsing. This is just to prove the concept - the idea would be to add back plugins one by one and fix the related issues as they come up. See [./src/custom-jimp.ts](./src/custom-jimp.ts).\n 2. Add polyfills for node modules (see [`./vite.config.ts`](./vite.config.ts)) and [`./src/node-polyfills.ts`](`./src/node-polyfills.ts`).\n 3. Patch jimp packages to use proper ESM. i.e. almost all of JIMP is written in ESM but the code they provide in the package pointed to by `\"module\"` is not ESM. This is done via `patch-package`.\n 4. Change `@jimp/core/src/request.js` to be proper ESM code. In this case it was commonJS file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielholmes%2Fjimp-vite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielholmes%2Fjimp-vite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielholmes%2Fjimp-vite/lists"}