{"id":21893611,"url":"https://github.com/xhmm/funpack","last_synced_at":"2026-04-15T18:32:37.367Z","repository":{"id":59144946,"uuid":"527969223","full_name":"XHMM/funpack","owner":"XHMM","description":"Funpack is a bundler specifically for better writing cloud functions(aka, a project that has multi entrypoints). ","archived":false,"fork":false,"pushed_at":"2022-08-23T18:13:59.000Z","size":15,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T02:51:29.691Z","etag":null,"topics":["cloudfunction","wechat-mini-program"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/XHMM.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}},"created_at":"2022-08-23T11:57:05.000Z","updated_at":"2022-10-17T06:33:36.000Z","dependencies_parsed_at":"2022-09-13T22:51:18.330Z","dependency_job_id":null,"html_url":"https://github.com/XHMM/funpack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Ffunpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Ffunpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Ffunpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Ffunpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XHMM","download_url":"https://codeload.github.com/XHMM/funpack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902918,"owners_count":20529114,"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":["cloudfunction","wechat-mini-program"],"created_at":"2024-11-28T13:15:26.089Z","updated_at":"2026-04-15T18:32:37.311Z","avatar_url":"https://github.com/XHMM.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eFunPack\u003c/h1\u003e\n\u003cp\u003e\nFunpack is a bundler specifically for better writing cloud functions(aka, a project that has multi entrypoints). It allows you to share common logic between isolated functions, and have a better development experience.\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n## Basic\n\nYour project folder should follow this structure:\n```\nroot\n├── funpack.config.js\n├── package.json\n├── src\n│   ├── functions\n│   │   ├── register\n│   │   │   ├── config.json \n│   │   │   └── index.ts\n│   │   └── user-info\n│   │       ├── config.json\n│   │       └── index.ts\n│   ├── types.ts\n│   └── utils.ts\n└── tsconfig.json\n\n```\n\n- `funpack.config.js`: config file for `funpack`\n- `src/functions`: all your functions are under this folder\n  - `src/functions/[fnName]/index.ts`: function entry file\n  - `src/functions/[fnName]/[non-ts-file]`: any non-ts file will be copied to output without modify\n- `src/[shardFile].ts`: shard files should be outside of functions folder\n\n\n## Install\nInstall with npm:\n```shell\nnpm install --save-dev @funpack/cli\n```\n\nInstall with yarn:\n```shell\nyarn add @funpack/cli --dev\n```\n\n## Templates\n- [wxmini-cloud](/packages/create-funpack/template-wxmini-cloud): a template for wechat miniprogram cloud functions development\n\n## References\n\n### Commands\n\n- `funpack --watch`: Build and watch functions\n- `funpack`: Build functions (Set `process.env.NODE_ENV` to 'production' if you want production build)\n\n\n### `funpack.config.js`\nThis file need export default a config object:\n```typescript\ninterface UserFunpackConfig {\n  output?: {\n    /**\n     * functions will output to `projectRoot/[dir]/functions`\n     * \n     * default: dist\n     */\n    dir?: string; \n    \n    /** \n     * soucemap config, check https://webpack.js.org/configuration/devtool/#devtool for available values\n     * \n     * default: NODE_ENV == 'production' ? \"hidden-source-map\" : \"eval-source-map\"\n     * */\n    sourceMap?: string | false;\n  };\n  \n  bundle: {\n    /**\n     * config output strategy\n     * if true, node modules used by function will be bundled,\n     * if false, package.json will be generated under every function\n     * \n     * default: true\n     */\n    singleFile?: boolean;\n  };\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhmm%2Ffunpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxhmm%2Ffunpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhmm%2Ffunpack/lists"}