{"id":20832193,"url":"https://github.com/scbd/dist-builder","last_synced_at":"2026-04-20T18:32:27.932Z","repository":{"id":143790484,"uuid":"611918952","full_name":"scbd/dist-builder","owner":"scbd","description":"vite based dist builder supporting widgets (embeddable vue components )","archived":false,"fork":false,"pushed_at":"2023-03-13T19:07:35.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"4770","last_synced_at":"2025-11-23T14:02:16.011Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/scbd.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":"2023-03-09T20:14:28.000Z","updated_at":"2023-03-09T20:21:15.000Z","dependencies_parsed_at":"2023-12-19T02:17:22.194Z","dependency_job_id":null,"html_url":"https://github.com/scbd/dist-builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scbd/dist-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fdist-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fdist-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fdist-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fdist-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scbd","download_url":"https://codeload.github.com/scbd/dist-builder/tar.gz/refs/heads/4770","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scbd%2Fdist-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32059763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"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-18T00:10:40.644Z","updated_at":"2026-04-20T18:32:27.927Z","avatar_url":"https://github.com/scbd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dist-builder\n\nIs a vite based too to assist in developing, testing and deploying self embedding vue components.  The latest version is based on [js import maps](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap).  This greatly reduces build complexity elimination the need for a separate  browser build and server/tooling build.\n\nThe caveat is that browsers only permit one import map loaded.  This posses a problem for multiple independent components.  Thus dist-build is dependant on the package [es-module-shims](https://www.npmjs.com/package/es-module-shims).\n\ndist-builder utilizes [es-module-shims](https://www.npmjs.com/package/es-module-shims) in shim mode.  This permits the import of external and multiple import maps currently not supported by any browser.  Further, will polyfill what is needed for the 5% of browsers that do not support ES Modules presently.  As a result 72% us users are passed through utilizing the browsers native functions. Usage results in  ~5ms extra initialization time over native for ES Module Shims fetching, execution and initialization with an 10kb additional download.\n\n[es-module-shims](https://www.npmjs.com/package/es-module-shims)\n\n# CLI Commands\n\n## build\n\n```${ yarn | npx} dist-builder build```\n\nWill build a self embedding vue component utilizing vite, building from 2 entry points widget.js and the default.  Build will transpiles to the dist folder.  Do to complexity all other build formats were removed and now only builds in es format.  A dev folder inside dist also builds an es version not minified for preview and preview widget testing.\n\n## releaseDev [-f]\n\n```${ yarn | npx} dist-builder releaseDev```\n\nWill release a package to scbd's dev component host ```https://scbd-components.s3.amazonaws.com/${packageName}@${packageVersion}/dist/widget/index.js```.\n\n-f options will overwrite an existing version if it exists.\n\n\nTest the widget released on dev:\n\n\n```\n\u003cscript \n      type = \"module\"\n      src  = \"https://scbd-components.s3.amazonaws.com/%40scbd/idb-views%400.0.2-alpha/dist/widget/index.js\"\n      options = \"{ \n                    debug      : true,\n                    baseApiUrl : 'https://api.cbddev.xyz/api',\n                    accountsUrl: 'https://accounts.cbddev.xyz',\n                    year       : 2023,\n                    view       : 'IdbActionsAdmin',\n                    editUrl    : 'https://rjh.bioland.cbddev.xyz/idb-message'\n                  }\"\u003e \n\u003c/script\u003e\n```\n\n# dist-builder.config.js\n\n```\nimport  DistBuilder from '@scbd/dist-builder';\n\nconst { viteConfig,  external:deps, getPackageVersion } = DistBuilder;\n\nexport const debug   =  true; // see errors when building\nexport const minify  =  true; // minify production version\nexport const globals = { vue: 'Vue', 'vue-i18n': 'VueI18n'}; // global within the module scope\n\nexport const cdnUrl  = 'https://cdn.jsdelivr.net/npm';  //cdn url where replaced excluding import maps\n\nexport const widget           = true; // will this component have a widget entry?\nexport const testWidget       = true; // build a test widget to for preview \nexport const includeInBuild   = [  ]; //  all deps that should be bushed into build and not retrieved from cdn\n\n\n// point to a different location in import map other than esm.sh\nexport const importMapOverRide = {\n    'pinia'                                         : `https://cdn.jsdelivr.net/npm/pinia@${getPackageVersion('pinia')}/dist/pinia.esm-browser.js`\n}\n\n// include extra deps in the import map not seen in package\nexport const importExtras = {\n    'https://esm.sh/stable/vue@3.2.47/es2022/vue.js': `https://esm.sh/stable/vue@3.3.0-alpha.4/es2022/vue.js`,\n    '@vue/devtools-api'                             : `https://esm.sh/@vue/devtools-api@^6.5.0`,\n    'json5'                                         : `https://esm.sh/json5@2.2.3`\n}\n\nconst external = deps.filter((item)=\u003e!includeInBuild.includes(item)); // everything is external except specified\n\n// main config export used by the dist builder, cannot be in vit config ... calling it  self\nexport const distBuilderConfig = {\n    widget, testWidget, cdnUrl, external, debug, minify, globals, importMapOverRide, importExtras\n}\n\n// format it for vite yet called multiple times\nexport const makeViteConfig = () =\u003e viteConfig(distBuilderConfig)\n\nexport default makeViteConfig\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscbd%2Fdist-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscbd%2Fdist-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscbd%2Fdist-builder/lists"}