{"id":15680664,"url":"https://github.com/aminya/astro-parcel","last_synced_at":"2025-05-07T10:34:31.717Z","repository":{"id":41469104,"uuid":"509738590","full_name":"aminya/astro-parcel","owner":"aminya","description":"Build and optimize your Astro project using Parcel","archived":false,"fork":false,"pushed_at":"2023-10-01T22:17:57.000Z","size":1079,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T10:34:30.510Z","etag":null,"topics":["asto-plugin","astro","bundle","html","optimize","parcel","posthtml"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aminya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null},"funding":{"github":["aminya"],"polar":"aminya","patreon":"aminya"}},"created_at":"2022-07-02T11:36:12.000Z","updated_at":"2023-12-28T05:14:00.000Z","dependencies_parsed_at":"2022-08-10T02:27:20.153Z","dependency_job_id":"106ccb43-9071-4fba-ac3c-85b0a4ec5dbc","html_url":"https://github.com/aminya/astro-parcel","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-parcel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-parcel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-parcel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-parcel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminya","download_url":"https://codeload.github.com/aminya/astro-parcel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252860195,"owners_count":21815479,"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":["asto-plugin","astro","bundle","html","optimize","parcel","posthtml"],"created_at":"2024-10-03T16:43:50.310Z","updated_at":"2025-05-07T10:34:31.672Z","avatar_url":"https://github.com/aminya.png","language":"TypeScript","readme":"# astro-parcel\n\nBuild and optimize your Astro project using Parcel\n\n## Install\n\n```\nnpm i --save-dev astro-parcel\n```\n\n## CLI\n\n```ps1\n\nastro-parcel \u003ccommand\u003e [options]\nBuild and optimize your astro project using Parcel\n\nCommands\nbuild\ndev\nserve\n\nOptions\n--astroDist \u003cstring = \"./dist\"\u003e     the directory that astro writes the build result to\n--parcelDist \u003cstring = \"./dist\"\u003e    the directory to output the parcel result\n--publicDir \u003cstring = \"./public\"\u003e   the public folder path. The files that are directly copied to parcelDist folder\n--srcDir \u003cstring = \"./src\"\u003e         the src folder. This path is used to search for the files that are not present in astroDist folder\n\nExtra arguments are directly passed to Astro and then Parcel\n\nAdvanced Options\n--astroJs \u003cstring = resolved\u003e       the astro cli js path\n--parcelJs \u003cstring = resolved\u003e      the parcel cli js path\n--nodeBin  \u003cstring = current node\u003e  the node bin path\n```\n\nTo use astro-parcel, you should configure your Astro project like normal. Then, call the astro-parcel commands.\n\nTo build the project:\n\n```ps1\nastro-parcel build\n```\n\nYou can also specify the build directory for Parcel via `--parcelDist`. If you have changed the `outDir` of Astro, you should pass it here as `--astroDist`:\n\n```ps1\nastro-parcel build --astroDist \"./dist\" --parcelDist \"./parcel-dist\"\n```\n\nTo use another version of Astrojs or Parceljs pass their binary js paths via `--astroJs` and `--parcelJs`.\n\n```ps1\nastro-parcel build --astroDist \"./dist\" --parcelDist \"./parcel-dist\" --parcelJs \"./node_modules/parcel/lib/bin.js\" --astroJs \"./node_modules/astro/dist/cli/index.js\"\n```\n\n## Why\n\nAstro is a great framework for making websites, and Parcel provides awesome bundling and optimization (e.g. Parcel-CSS, HTMLNano, etc.) functionality out of the box. This package makes it possible to use Astro with Parcel.\n\n## Using Parcel as the CSS, LESS, SCSS Bundler\n\nAstro's CSS bundling can result in duplicate files, while Parcel's CSS functionality is great in optimizing the CSS files. To use that, link the style files like the following. Use a unique file name, so astro-parcel can resolve it in the source directory. The `await import` is used for the `dev` build, and the `\u003clink\u003e` tag is used by for the production build.\n\n```astro\n\n---\nif (process.env.NODE_ENV !== \"production\") {\n  await import(\"./style.scss\")\n}\n---\n\n\u003chead\u003e\n  \u003clink rel=\"stylesheet\" href=\"./styles.scss\" class=\"href\"\u003e\n\u003c/head\u003e\n\n```\n\nTo use a single CSS bundle for the whole website, create a `./pages/styles.scss` and import all the CSS files used in your Page, and link it to your HTML files under the pages folder.\n\n```scss\n@use \"../components/navbar/navbar.scss\";\n@use \"../components/footer/footer.scss\";\n```\n","funding_links":["https://github.com/sponsors/aminya","https://polar.sh/aminya","https://patreon.com/aminya"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminya%2Fastro-parcel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminya%2Fastro-parcel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminya%2Fastro-parcel/lists"}