{"id":13452241,"url":"https://github.com/fastpack/fastpack","last_synced_at":"2025-05-14T14:08:32.112Z","repository":{"id":28232610,"uuid":"94413120","full_name":"fastpack/fastpack","owner":"fastpack","description":"Pack JS code fast \u0026 easy","archived":false,"fork":false,"pushed_at":"2023-01-07T13:46:06.000Z","size":7761,"stargazers_count":2265,"open_issues_count":35,"forks_count":41,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-05-08T16:37:00.759Z","etag":null,"topics":["bundler","javascript"],"latest_commit_sha":null,"homepage":"https://fastpack.sh","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastpack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["zindel","andreypopp"],"open_collective":"fastpack"}},"created_at":"2017-06-15T07:37:31.000Z","updated_at":"2025-04-22T14:57:55.000Z","dependencies_parsed_at":"2022-08-07T13:15:38.180Z","dependency_job_id":null,"html_url":"https://github.com/fastpack/fastpack","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastpack%2Ffastpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastpack%2Ffastpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastpack%2Ffastpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastpack%2Ffastpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastpack","download_url":"https://codeload.github.com/fastpack/fastpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253857893,"owners_count":21974829,"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":["bundler","javascript"],"created_at":"2024-07-31T07:01:18.052Z","updated_at":"2025-05-14T14:08:32.079Z","avatar_url":"https://github.com/fastpack.png","language":"OCaml","readme":"# Fastpack\n\n[![Build Status](https://dev.azure.com/fastpack/fastpack/_apis/build/status/fastpack.fastpack)](https://dev.azure.com/fastpack/fastpack/_build/latest?definitionId=1)\n[![Backers on Open Collective](https://opencollective.com/fastpack/backers/badge.svg)](#backers)\n [![Sponsors on Open Collective](https://opencollective.com/fastpack/sponsors/badge.svg)](#sponsors)\n\nPack JS code into a single bundle fast \u0026 easy.\n\n## Why?\n\nBecause JavaScript builds should be faster!\n\nHere is an example benchmark of bundling ~1600 modules together.\n\n\n|   | Fastpack| Parcel| Webpack\n|----|:--:|:--:|:--:\n| initial build| **0.730s**| 9.740s| 3.625s\n| persistent cache| **0.171s**| 1.218s| N/A\n| watch mode| **0.084s**| 0.503s| 0.473s\n\n## Getting Started\n\nLet's try building a simple React application!\n\n```Bash\n  $ mkdir react-app\n  $ cd react-app\n  $ yarn init -y\n  $ yarn add react react-dom\n  $ yarn add --dev fastpack\n  $ yarn add --dev babel-loader babel-preset-react-app style-loader css-loader url-loader\n```\n\n**src/index.js**\n```JavaScript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'));\n```\n\n**src/index.css**\n```CSS\nbody {\n  margin: 0;\n  padding: 0;\n  font-family: sans-serif;\n}\n```\n\n**src/App.js**\n```JavaScript\nimport React, { Component } from 'react';\nimport logo from './logo.svg';\nimport './App.css';\n\nclass App extends Component {\n  render() {\n    return (\n      \u003cdiv className=\"App\"\u003e\n        \u003cheader className=\"App-header\"\u003e\n          \u003cimg src={logo} className=\"App-logo\" alt=\"logo\" /\u003e\n          \u003ch1 className=\"App-title\"\u003eWelcome to React\u003c/h1\u003e\n        \u003c/header\u003e\n        \u003cp className=\"App-intro\"\u003e\n          To get started, edit \u003ccode\u003esrc/App.js\u003c/code\u003e and save to reload.\n        \u003c/p\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nexport default App;\n```\n\n**src/App.css**\n```CSS\n.App {\n  text-align: center;\n}\n\n.App-logo {\n  animation: App-logo-spin infinite 20s linear;\n  height: 80px;\n}\n\n.App-header {\n  background-color: #222;\n  height: 150px;\n  padding: 20px;\n  color: white;\n}\n\n.App-title {\n  font-size: 1.5em;\n}\n\n.App-intro {\n  font-size: large;\n}\n\n@keyframes App-logo-spin {\n  from { transform: rotate(0deg); }\n  to { transform: rotate(360deg); }\n}\n```\n\n**index.html**\n```HTML\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\u003ctitle\u003eReact App\u003c/title\u003e\u003c/head\u003e\n\u003cbody\u003e\n\u003cdiv id=\"root\"\u003e\u003c/div\u003e\n\u003cscript type=\"text/javascript\" src=\"./bundle/index.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nAlso, add the `src/logo.svg` of your choice. Now let's add some config:\n\n**.babelrc**\n```JavaScript\n{\n    \"presets\": [\"react-app\"]\n}\n```\n\nAnd the fastpack configuration as well:\n\n**fastpack.json**\n```JavaScript\n{\n    \"entryPoints\": [\"src/index.js\"],\n    \"preprocess\": [\n        {\n            \"re\": \"^src.+\\\\.js$\",\n            \"process\": \"babel-loader\"\n        },\n        {\n            \"re\": \"\\\\.svg$\",\n            \"process\": \"url-loader\"\n        },\n        {\n            \"re\": \"\\\\.css$\",\n            \"process\": \"style-loader!css-loader\"\n        }\n    ]\n}\n```\n\n*The above configuration can be alternatively specified using command-line\narguments, for more details run:*\n\n```Bash\n  $ node_modules/.bin/fpack --help\n```\n\nWe are good to go! Now run:\n\n```Bash\n  $ node_modules/.bin/fpack build --dev\n  Cache: empty\n  Done in 0.817s. Bundle: 942Kb. Modules: 30.\n  $ open index.html\n```\n\nVoila! Now try running it again and see the power of the persistent cache!\n\n```Bash\n  $ node_modules/.bin/fpack build --dev\n  Cache: used\n  Done in 0.032s. Bundle: 942Kb. Modules: 30.\n```\n\nFor more configuration options and usage scenarios see\n[Documentation](https://fastpack.sh/docs/get-started.html).\n\nHave a question or want to contribute? Join us on [Discord](https://discord.gg/4HVCjDh)!\n\n## Contributors\n\nThis project exists thanks to all the people who contribute.\n\u003ca href=\"https://github.com/fastpack/fastpack/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\nSpecial thanks to [@camsong](https://github.com/camsong) for providing the\n[fastpack](https://www.npmjs.com/package/fastpack) name on\n[npmjs.com](npmjs.com)!\n\n\n## Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/fastpack#backer)]\n\n\u003ca href=\"https://opencollective.com/fastpack#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n\n## Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/fastpack#sponsor)]\n\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/0/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/1/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/2/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/3/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/4/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/5/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/6/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/7/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/8/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/fastpack/sponsor/9/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/fastpack/sponsor/9/avatar.svg\"\u003e\u003c/a\u003e\n\n\n","funding_links":["https://github.com/sponsors/zindel","https://github.com/sponsors/andreypopp","https://opencollective.com/fastpack"],"categories":["OCaml","Projects","Tool","javascript","Programming Languages","Code bundlers"],"sub_categories":["JavaScript","Server-rendered React"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastpack%2Ffastpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastpack%2Ffastpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastpack%2Ffastpack/lists"}