{"id":15200021,"url":"https://github.com/nasriyasoftware/postbuild","last_synced_at":"2026-02-06T04:02:30.719Z","repository":{"id":243348148,"uuid":"812173264","full_name":"nasriyasoftware/PostBuild","owner":"nasriyasoftware","description":"PostBuild is a utility pacakge for TypeScript run useful tasks after transpiling TypeScript into ESM and CJS JavaScript file.","archived":false,"fork":false,"pushed_at":"2024-08-17T18:48:14.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T23:02:18.428Z","etag":null,"topics":["babel","babel-plugin","cjs","commonjs","commonjs-modules","ecmascript","esm","esmodules","node","nodejs","tsc","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@nasriya/postbuild","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nasriyasoftware.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-08T06:31:35.000Z","updated_at":"2024-09-12T19:46:48.000Z","dependencies_parsed_at":"2024-06-08T08:36:46.797Z","dependency_job_id":"b325bc5d-4a2b-44e4-8696-262c96972430","html_url":"https://github.com/nasriyasoftware/PostBuild","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"7b9b09a8423866db5516e65134023e337bd58dea"},"previous_names":["nasriyasoftware/postbuild"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/nasriyasoftware/PostBuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasriyasoftware%2FPostBuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasriyasoftware%2FPostBuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasriyasoftware%2FPostBuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasriyasoftware%2FPostBuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nasriyasoftware","download_url":"https://codeload.github.com/nasriyasoftware/PostBuild/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nasriyasoftware%2FPostBuild/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263047659,"owners_count":23405280,"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":["babel","babel-plugin","cjs","commonjs","commonjs-modules","ecmascript","esm","esmodules","node","nodejs","tsc","typescript"],"created_at":"2024-09-28T02:40:19.598Z","updated_at":"2026-02-06T04:02:30.690Z","avatar_url":"https://github.com/nasriyasoftware.png","language":"JavaScript","readme":"[![N|Solid](https://static.wixstatic.com/media/72ffe6_da8d2142d49c42b29c96ba80c8a91a6c~mv2.png)](https://nasriya.net)\n# PostBuild.\n[![Static Badge](https://img.shields.io/badge/license-Free_(Restricted)-blue)](https://github.com/nasriyasoftware/PostBuild?tab=License-1-ov-file) ![Repository Size](https://img.shields.io/github/repo-size/nasriyasoftware/PostBuild.svg) ![Last Commit](https://img.shields.io/github/last-commit/nasriyasoftware/PostBuild.svg) [![Status](https://img.shields.io/badge/Status-Stable-green.svg)](link-to-your-status-page)\n##### Visit us at [www.nasriya.net](https://nasriya.net).\n\nPostBuild is a utility pacakge for **TypeScript** that runs useful tasks after transpiling TypeScript into **ESM** and **CJS** JavaScript file.\n\nMade with ❤️ in **Palestine** 🇵🇸\n\n\u003e [!IMPORTANT]\n\u003e 🌟 **Support Our Open-Source Development!** 🌟\n\u003e We need your support to keep our projects going! If you find our \u003e work valuable, please consider contributing. Your support helps us \u003e continue to develop and maintain these tools.\n\u003e \n\u003e **[Click here to support us!](https://fund.nasriya.net/)**\n\u003e \n\u003e Every contribution, big or small, makes a difference. Thank you for \u003e your generosity and support!\n___\n## Installation\nInstall the pacakge as a dev. dependency:\n```shell\nnpm i --save-dev @nasriya/postbuild\n```\n\n## Config File\nThe `postbuild.configs.json` is the file where all your configurations reside, and is needed to perform the tasks or the build process will fail.\n\nIf you don't have a file, just run the following command and a file will be generated with recommended configurations:\n\n```shell\nnpm run postbuild-init\n```\n\n##### Config File Content\nThe above comand will generate a file with all the features set to their recommended values. This table below explains them in details.\n\n| Property            | Description                                                              | Posible values           | Default value |\n| ------------------- | ------------------------------------------------------------------------ | ------------------------ | ------------- |\n| `esmDir`            | The directory of the generated `ESM` folder.                             | `auto` or the directory  | `auto`        |\n| `cjsDir`            | The directory of the generated `CJS` folder.                             | `auto` or the directory  | `auto`        |\n| `verbose`           | An option to enable logging extra details .                              | `true` or `false`        | `true`        |\n| `addExtensions`     | Appending `.js` to all import statements.                                | `true` or `false`        | `true`        |\n| `copyFiles`         | An options object to copy assets to the `dist` folder after transpiling. | `object` or `undefined`  | Notice below  |\n| `copyFiles.from`    | The directory where you want to copy the assets to.                      | directory                | `src`         |\n| `copyFiles.exclude` | An array of file extensions to exclude.                                  | `string[]`               | `['.ts']`     |\n| `aliases`           | Define aliases to your imports                                           | `Record\u003cstring, string\u003e` | Nothing       |\n\nThe default configurations works well if your project is structured like this:\n```\n├── dist/\n│   ├── @types\n│   ├── cjs\n│   └── esm\n├── src\n│   ├── folder1\n│   ├── folder2\n│   ├── folder3\n│   └── index.ts\n├── package.json\n└── README.md\n```\n\n\n## Usage\nThe best way to use this package is to integrate it with your build process by appending the `postbuild` worker to the end of the `build` command:\n\n```json\n// package.json\n{\n    \"scripts\": {\n        \"build\": \"npm run build:esm \u0026\u0026 npm run build:cjs \u0026\u0026 postbuild\",\n        \"build:esm\": \"tsc --project tsconfig.esm.json\",\n        \"build:cjs\": \"tsc --project tsconfig.cjs.json\",        \n    }\n}\n```\n\n#### Defining aliases\nIn `postbuild.config.json`, you can add your aliases as such:\n\n```json\n{\n    \"aliases\": {\n        \"my-module\": \"/modules/my-module\",\n        \"@elements/*\": \"/elements/\"\n    }\n}\n```\n\n#### Using `__dirname`\nAll `__dirname` matches in `ESM` will be replaced with `import.meta.dirname`, for example:\n\n```ts\n// TypeScript\nconst dirname: string = __dirname;\n```\n\nWill be compiled to:\n```js\n// CommonJS (CJS)\nconst dirname = __dirname;\n```\n\n```js\n// ECMAScript Modules (ESM)\nconst dirname = import.meta.dirname;\n```\n___\n## License\nPlease read the license from [here](https://github.com/nasriyasoftware/PostBuild?tab=License-1-ov-file).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasriyasoftware%2Fpostbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnasriyasoftware%2Fpostbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnasriyasoftware%2Fpostbuild/lists"}