{"id":13417246,"url":"https://github.com/jspm/vite-plugin-jspm","last_synced_at":"2025-03-17T08:08:37.419Z","repository":{"id":40894181,"uuid":"469643421","full_name":"jspm/vite-plugin-jspm","owner":"jspm","description":"A plugin which externalizes dependencies and resolves them from CDN providers using import maps and es-module-shims!","archived":false,"fork":false,"pushed_at":"2024-09-09T08:28:58.000Z","size":515,"stargazers_count":59,"open_issues_count":2,"forks_count":9,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-10-30T04:30:07.865Z","etag":null,"topics":["cdn","es-module-shims","import-maps","jspm","plugin","skypack","unpkg","vite"],"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/jspm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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},"funding":{"github":["jspm"],"patreon":null,"open_collective":"jspm","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2022-03-14T08:30:40.000Z","updated_at":"2024-09-18T06:13:06.000Z","dependencies_parsed_at":"2024-11-09T20:44:32.120Z","dependency_job_id":null,"html_url":"https://github.com/jspm/vite-plugin-jspm","commit_stats":{"total_commits":94,"total_committers":3,"mean_commits":"31.333333333333332","dds":"0.32978723404255317","last_synced_commit":"e8eaab658b3347bf44b18e61481e6e0a71c41a6a"},"previous_names":["aslemammad/vite-plugin-jspm"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jspm%2Fvite-plugin-jspm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jspm%2Fvite-plugin-jspm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jspm%2Fvite-plugin-jspm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jspm%2Fvite-plugin-jspm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jspm","download_url":"https://codeload.github.com/jspm/vite-plugin-jspm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243815361,"owners_count":20352150,"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":["cdn","es-module-shims","import-maps","jspm","plugin","skypack","unpkg","vite"],"created_at":"2024-07-30T22:00:34.493Z","updated_at":"2025-03-17T08:08:37.395Z","avatar_url":"https://github.com/jspm.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jspm","https://opencollective.com/jspm"],"categories":["Plugins"],"sub_categories":["Framework-agnostic Plugins"],"readme":"# vite-plugin-jspm\n\n\u003e Import maps: a way to control the behavior of JavaScript imports. [WICG/import-maps](https://github.com/WICG/import-maps)\n\n\u003e CDN: A content delivery network (CDN) refers to a geographically distributed group of servers which work together to provide fast delivery of Internet content. [Cloudflare.com](https://www.cloudflare.com/en-ca/learning/cdn/what-is-a-cdn/)\n\nA vite plugin which externalizes dependencies and resolves them independently from **CDN (Content Delivery Network) providers** using [import maps](https://github.com/WICG/import-maps) and [es-module-shims](https://github.com/guybedford/es-module-shims)!\nThis plugin generates an import map for your app automatically in both development and production, and resolves dependencies based on that.\n\nIt is based on [@jspm/generator](https://github.com/jspm/generator) which supports different providers like _jspm_, _unpkg_ and _skypack_.\n\n## Usage\n\n```ts\nimport { defineConfig } from \"vite\";\nimport jspmPlugin from \"vite-plugin-jspm\";\n\nexport default defineConfig({\n  plugins: [jspmPlugin()],\n});\n```\n\n## Custom options\n\n### `inputMap`\n\n`inputMap` is a `@jspm/generator` option. When passed, the plugin takes it as source of truth. And resolves the imports against it.\n\n### `downloadDeps`\n\nWhen passed, downloads the dependencies and bundles them with the build. But in dev mode `vite dev`, the plugin serves the dependencies from the CDN.\n\n### env\n\n`env` is a `@jspm/generator` option. Users don't need to pass `production` or `development` option. The env is applied according to the vite env.\n\n### debug\n\n`debug` let's you skim through the logs during resolution and downloading pahses.\n\n### pollyfillProvider\n\n`pollyfillProvider` allow users to define their own pollyfill provider instead of `ga.jspm.io`, it can be a function `(version: string) =\u003e string` or a `string`. For function,  the parameter `version` is `es-module-shims`'s version, user should return a complete url like `https://ga.jspm.io/npm:es-module-shims@1.8.0/dist/es-module-shims.js`.\n\n# Bundle size\n\nYou can see the bundle size of [`test/basic`](https://github.com/jspm/vite-plugin-jspm/tree/main/test/basic) example in two cases:\n\n```\n# with this plugin\nvite v4.1.1 building for production...\n✓ 16 modules transformed.\nbuild/index.html                  4.80 kB\nbuild/assets/index-8f42e5ff.css   9.58 kB │ gzip: 1.64 kB\nbuild/assets/index-37524fa0.js   14.11 kB │ gzip: 3.71 kB\n\n# with downloadDeps flag in the plugin\nvite v4.1.1 building for production...\n✓ 45 modules transformed.\nbuild/index.html                   2.42 kB\nbuild/assets/index-8f42e5ff.css    9.58 kB │ gzip:  1.64 kB\nbuild/assets/index-38fd63e9.js   187.02 kB │ gzip: 59.80 kB\n```\n\n# Contribution\n\nFeel free to open issues and PRs!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjspm%2Fvite-plugin-jspm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjspm%2Fvite-plugin-jspm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjspm%2Fvite-plugin-jspm/lists"}