{"id":20054387,"url":"https://github.com/divriots/vite-plugin-bundled-entry","last_synced_at":"2025-05-05T13:31:22.951Z","repository":{"id":45581370,"uuid":"434232713","full_name":"divriots/vite-plugin-bundled-entry","owner":"divriots","description":"Vite plugin that generates a bundled entry file.","archived":false,"fork":false,"pushed_at":"2024-01-25T13:53:21.000Z","size":62,"stargazers_count":25,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-04T07:45:58.536Z","etag":null,"topics":[],"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/divriots.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}},"created_at":"2021-12-02T13:32:15.000Z","updated_at":"2024-10-30T10:27:47.000Z","dependencies_parsed_at":"2024-11-13T12:40:23.052Z","dependency_job_id":"2d540173-d29e-486d-a7e5-65abc2ad449d","html_url":"https://github.com/divriots/vite-plugin-bundled-entry","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.30000000000000004","last_synced_commit":"067381489a8e232ea086cdb4aa55ecb9ac42a95d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fvite-plugin-bundled-entry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fvite-plugin-bundled-entry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fvite-plugin-bundled-entry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divriots%2Fvite-plugin-bundled-entry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divriots","download_url":"https://codeload.github.com/divriots/vite-plugin-bundled-entry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252506411,"owners_count":21759042,"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-13T12:40:16.796Z","updated_at":"2025-05-05T13:31:22.664Z","avatar_url":"https://github.com/divriots.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-bundled-entry [![npm](https://img.shields.io/npm/v/vite-plugin-bundled-entry.svg)](https://www.npmjs.com/package/vite-plugin-bundled-entry)\n\n\u003cp\u003e\n  \u003ca href=\"https://divRIOTS.com\"\u003eBrought to you by\u003cbr/\u003e\u003c/a\u003e\n  \u003ca href=\"https://divRIOTS.com#gh-light-mode-only\" target=\"_blank\"\u003e\n        \u003cimg width=\"150\" height=\"40\" src=\"https://divRIOTS.com/divriots.svg#gh-light-mode-only\" alt=\"‹div›RIOTS\" /\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://divRIOTS.com#gh-dark-mode-only\" target=\"_blank\"\u003e\n        \u003cimg width=\"150\" height=\"40\" src=\"https://divRIOTS.com/divriots-dark.svg#gh-dark-mode-only\" alt=\"‹div›RIOTS\" /\u003e\n        \u003c/a\u003e\n\u003c/p\u003e\n\n\n### Purpose\n\nVite goes to great length *not* to bundle anything (in dev), but there are cases where you've got no choice but to bundle.\nSome examples are:\n- worker (web/shared/service) which need to run as IIFE and *not* `{type: 'module}` (e.g. using `importScripts`)\n- JS entry point which needs to be available dynamically at runtime (e.g. in an iframe)\n\n### Installation\n\n```\nnpm install --save-dev vite-plugin-bundled-entry\n```\n\n### Usage\n\nAdd it to vite.config.js\n\n```js\nimport bundledEntryPlugin from 'vite-plugin-bundled-entry';\n\nexport default {\n  plugins: [bundledEntryPlugin({\n    id: 'some_virtual_id',\n    outFile: '/assets/mybundle.[hash].js',\n    entryPoint: 'src/path/to/entryfile.js',\n    esbuildOptions: {\n      // (optional) esbuild options to use for bundling\n      minify: process.env.NODE_ENV === 'production',\n      format: 'iife', // default \"esm\"\n    },\n    transform(code) {\n      // (optional) transform to apply on generated bundle\n    }\n  })]\n}\n```\n\nIn your code\n\n```js\nimport url from 'some_virtual_id?url';\n// will be /assets/mybundle.[hash].js (with hash placeholder replaced in build mode)\n\nfunction createWorker() {\n  return new Worker(url);\n}\n```\n\n### License\n\n[MIT](https://opensource.org/licenses/MIT)\n\nCopyright (c) 2021-present, \u003cDIV\u003eRiots\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivriots%2Fvite-plugin-bundled-entry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivriots%2Fvite-plugin-bundled-entry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivriots%2Fvite-plugin-bundled-entry/lists"}