{"id":20349227,"url":"https://github.com/strapi/pack-up","last_synced_at":"2025-04-12T01:23:13.247Z","repository":{"id":232615870,"uuid":"784662223","full_name":"strapi/pack-up","owner":"strapi","description":"Simple tools for creating interoperable CJS \u0026 ESM packages.","archived":false,"fork":false,"pushed_at":"2024-05-20T13:19:22.000Z","size":186,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-05-20T13:34:37.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/strapi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-04-10T09:50:36.000Z","updated_at":"2024-05-20T13:34:43.622Z","dependencies_parsed_at":null,"dependency_job_id":"d9a40d33-8408-4203-bdc2-d126834f797f","html_url":"https://github.com/strapi/pack-up","commit_stats":null,"previous_names":["strapi/pack-up"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fpack-up","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fpack-up/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fpack-up/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fpack-up/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strapi","download_url":"https://codeload.github.com/strapi/pack-up/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248502231,"owners_count":21114767,"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-14T22:24:45.519Z","updated_at":"2025-04-12T01:23:13.222Z","avatar_url":"https://github.com/strapi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003epack-up\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eYour daily lunchbox of bundling tools\u003c/h3\u003e\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@strapi/pack-up\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@strapi/pack-up.svg?style=flat\u0026colorA=4945ff\u0026colorB=4945ff\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@strapi/pack-up\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/@strapi/pack-up.svg?style=flat\u0026colorA=4945ff\u0026colorB=4945ff\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/strapi\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/discord/811989166782021633?style=flat\u0026colorA=4945ff\u0026colorB=4945ff\u0026label=discord\u0026logo=discord\u0026logoColor=f0f0ff\" alt=\"Chat on Discord\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\npack-up is a set of simple tools for creating interoperable CJS \u0026 ESM packages.\n\nSetting up a new interoperable project is as easy as doing:\n\n```sh\nnpx @strapi/pack-up@latest init my-package\n\ncd my-package\n\nnpm run build\n```\n\nJust a small bit about us:\n\n- **Vite**: We support `vite` as a JS bundler, no need to install it though as it's preprepared with helpful defaults ready to tackle all projects.\n- **Concise**: It's all based off your `package.json` so you know the interoperable aspect is correctly set up and there's no requirement for another config!\n- **Flexible**: Need more customisation or to bundle a package not declared in your exports? Use the config file to dictate separate bundles \u0026 options.\n\n## Getting Started\n\nIf you're setting up a brand new package we recommend you use the `init` command to get started:\n\n```sh\nnpx @strapi/pack-up@latest init my-package\n```\n\nBut if you're adding this to an existing project then just install like every other dependency:\n\n```sh\nnpm install @strapi/pack-up@latest --save-dev\n```\n\nAnd to help you ensure your package is set up correctly run the `check` command:\n\n```sh\nnpm run pack-up check\n```\n\nRun `pack-up -h` for more information on CLI usage.\n\n## Commands\n\n### `init [path]`\n\nCreates a new package at the given path, by default uses the inbuilt template sensible options for your package to choose from.\n\n- `--template [path]` – path to a custom template of type `TemplateOrTemplateResolver`.\n\n### `build`\n\nBuilds your current package based on the configuration in your `package.json` and `packup.config.ts` (if applicable).\n\n- `--minify` – minifies the output (default `false`).\n- `--sourcemap` – generates sourcemaps for the output (default `true`).\n\n### `check`\n\nChecks your current package to ensure it's interoperable in the real world. In short, validates the files in your dist have been produced as we expect \u0026 then `esbuild` can actually build, using your exported code.\n\n### `watch`\n\nWatches your current package for changes and rebuilds when necessary.\n\n## Configuration\n\n`@strapi/pack-up` by default reads its configuration from your `package.json`. But sometimes you need more flexibility, to do this you can create a `packup.config.ts` file in the root of your package.\n\n```ts\n// packup.config.ts\nimport { defineConfig } from '@strapi/pack-up';\n\nexport default defineConfig({\n  minify: true,\n  sourcemap: false,\n  externals: ['path', 'fs'],\n});\n```\n\n### Options\n\n#### `bundles`\n\n- Type: `ConfigBundle[]`\n\nAn array of entry points to bundle. This is useful if you want to bundle something that should not\nbe exported by the package, e.g. CLI scripts or Node.js workers.\n\n#### `dist`\n\n- Type: `string`\n\nThe path to the directory to which the bundled files should be written.\n\n#### `exports`\n\n- Type: `Record\u003cstring, Export\u003e`\n\nOverwrite or amend the parsed exports from your `package.json`.\n\n#### `externals`\n\n- Type: `string[]`\n\nAn array of modules that should not be bundled but instead be resolved at runtime, this is by default the dependencies listed in your `package.json` (excluding devDeps).\n\n#### `minify`\n\n- Type: `boolean`\n\nWhether to minify the output or not.\n\n#### `plugins`\n\n- Type: `PluginOption[] | (({ runtime }: { runtime: Runtime }) =\u003e PluginOption[]);`\n\nAn array of Vite plugins to use when bundling, or optionally a function that returns an array of plugins based on the runtime.\n\n#### `preserveModules`\n\n- Type: `boolean`\n\nInstead of creating as few chunks as possible, this mode will create separate chunks for all modules using the original module names as file names.\n\n#### `sourcemap`\n\n- Type: `boolean`\n\nWhether to generate sourcemaps for the output or not.\n\n#### `runtime`\n\n- Type: `Runtime`\n\nThe transpilation target of the bundle. This is useful if you're bundling many different CLIs or Node.js workers and you want them to be transpiled for the node environment.\n\n#### `tsconfig`\n\n- Type: `string`\n\nPath to the tsconfig file to use for the bundle, defaults to `tsconfig.build.json`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrapi%2Fpack-up","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrapi%2Fpack-up","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrapi%2Fpack-up/lists"}