{"id":19437948,"url":"https://github.com/architect/plugin-bundle","last_synced_at":"2026-05-12T13:42:33.537Z","repository":{"id":87188468,"uuid":"377623418","full_name":"architect/plugin-bundle","owner":"architect","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-16T20:46:52.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-25T07:16:09.350Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"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/architect.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":"2021-06-16T20:45:32.000Z","updated_at":"2024-09-30T23:39:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f9e9525-a94a-4048-854f-5eacc8cb0a2b","html_url":"https://github.com/architect/plugin-bundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/architect/plugin-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/architect","download_url":"https://codeload.github.com/architect/plugin-bundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32942140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10T15:16:20.460Z","updated_at":"2026-05-12T13:42:33.519Z","avatar_url":"https://github.com/architect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @architect/plugin-bundle\n\nAutomatically bundle `@views` into `/public/bundles`.\n\n```bash\nnpm install @architect/plugin-bundle\n```\n\n## Usage\n\nAdd to `app.arc`:\n\n```arc\n# app.arc\n@app\nmyapp\n\n@http\nget /\n\n@static\nignore bundles\n\n@plugins\narchitect/plugin-bundle\n```\n\nAdd a script tag to your HTML:\n\n```html\n\u003cscript src=/_entry/path/to/file.js type=module\u003e\u003c/script\u003e\n```\n\nThe following will happen:\n\n- We look for the requested origin file in `@views` (in this example case `src/views/path/to/file.js`)\n  - If it has already been bundled and if so return that path\n  - Otherwise it will bundle it with all its deps and write to s3\n- Browser is redirected to the bundled file\n\nIf you want to avoid the redirect you can call entry at runtime in your Lambda function code. Cache the bundled result outside the function handler for the best performance:\n\n```javascript\nlet entry = require('@architect/plugin-bundle')\nlet cache = false\n\nexports.handler = async function http (req) {\n\n  // get the path to bundled file\n  if (cache === false)\n    cache = await entry('/path/to/file.js')\n\n  // dynamic render html\n  return {\n    statusCode: 200,\n    headers: {\n      'content-type': 'text/html; charset=utf8' \n    },\n    body: `\n      \u003cstrong\u003emy cool html here\u003c/strong\u003e\n      \u003cscript type=module src=${cache}\u003e\u003c/script\u003e\n    `\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fplugin-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchitect%2Fplugin-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fplugin-bundle/lists"}