{"id":21367750,"url":"https://github.com/pakholeung37/vite-plugin-import-maps","last_synced_at":"2025-07-24T15:03:13.072Z","repository":{"id":57393156,"uuid":"432467452","full_name":"pakholeung37/vite-plugin-import-maps","owner":"pakholeung37","description":"Use native import-maps in vite.","archived":false,"fork":false,"pushed_at":"2022-08-21T18:24:12.000Z","size":84,"stargazers_count":17,"open_issues_count":4,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-13T05:39:19.114Z","etag":null,"topics":["import-maps","importmaps","vite","vite-plugin"],"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/pakholeung37.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}},"created_at":"2021-11-27T13:23:50.000Z","updated_at":"2025-04-03T00:50:10.000Z","dependencies_parsed_at":"2022-09-15T02:40:32.711Z","dependency_job_id":null,"html_url":"https://github.com/pakholeung37/vite-plugin-import-maps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pakholeung37/vite-plugin-import-maps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakholeung37%2Fvite-plugin-import-maps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakholeung37%2Fvite-plugin-import-maps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakholeung37%2Fvite-plugin-import-maps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakholeung37%2Fvite-plugin-import-maps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pakholeung37","download_url":"https://codeload.github.com/pakholeung37/vite-plugin-import-maps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakholeung37%2Fvite-plugin-import-maps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266052835,"owners_count":23869489,"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":["import-maps","importmaps","vite","vite-plugin"],"created_at":"2024-11-22T07:20:25.057Z","updated_at":"2025-07-24T15:03:12.940Z","avatar_url":"https://github.com/pakholeung37.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-import-maps\n\nUse native browser import-maps in vite. What's [import-maps](https://github.com/WICG/import-maps)\n\n[![NPM](https://nodei.co/npm/vite-plugin-import-maps.png)](https://npmjs.org/package/vite-plugin-import-maps/)\n\n## Usage\n\nSimply add import-maps plugin in vite.config\n\n```javascript\n// vite.config.js\nconst { defineConfig } = require('vite')\nconst { importMaps } = require('vite-plugin-import-maps')\n\nmodule.exports = defineConfig({\n  plugins: [\n    importMaps([\n      {\n        imports: {\n          lodash: 'https://esm.sh/lodash-es@4.17.20',\n        },\n      },\n    ]),\n  ],\n})\n```\n\nThen your module will import from cdn instead of vite pre-bundle module.\n\nCuz it use native import-maps, itt also allow you to use module in runtime.\n\n```html\n\u003c!-- index.html --\u003e\n\u003cscript type=\"module\"\u003e\n  import _, { isNaN } from 'lodash'\n\n  console.log(_.isNaN(NaN)) // true\n  console.log(isNaN(NaN)) // true\n\u003c/script\u003e\n```\n\n## Limitation\n\nUntil now, only Chrome implements the import-maps feature. But it is easy to use a polyfill with [es-module-shims](https://github.com/guybedford/es-module-shims).\n\nAnd to be ware, due to there is no way for vite to unresolve bare moduleId now, this plugin use an alia with the preifx `/@import-maps/`, which means `import 'lodash'` will transform to `import '/@import-maps/lodash'`.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpakholeung37%2Fvite-plugin-import-maps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpakholeung37%2Fvite-plugin-import-maps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpakholeung37%2Fvite-plugin-import-maps/lists"}