gitwtfhub

wtf is prepack?

facebookarchive/prepack — explained in plain English

Analysis updated 2026-06-24

14,117JavaScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TL;DR

An archived Facebook tool that pre-evaluates JavaScript before it runs, pre-computing constants and startup work so the optimized version loads faster. No longer actively maintained.

Mindmap

mindmap
  root((Prepack))
    What it does
      Pre-evaluates JS
      Computes constants early
      Rewrites output file
    How to use
      CLI via npm
      Webpack plugin
      Rollup plugin
      Parcel plugin
    Status
      Archived project
      Facebook origin
      No active maintenance
    For contributors
      Clone and build
      Run tests
      Website in repo

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Speed up a JavaScript app's startup time by pre-computing initialization work at build time.

REASON 2

Integrate Prepack into a Webpack or Rollup build pipeline to automatically optimize bundle output.

REASON 3

Study how a JavaScript partial evaluator works by reading through the archived research-grade source code.

REASON 4

Experiment with pre-evaluation concepts for academic or research purposes.

What's in the stack?

JavaScriptNode.js

How it stacks up

facebookarchive/prepackhttp-party/node-http-proxyelecterm/electerm
Stars14,11714,14114,079
LanguageJavaScriptJavaScriptJavaScript
Setup difficultymoderateeasyeasy
Complexity3/53/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Project is archived and no longer maintained, may not work with modern JavaScript syntax or current build tools.

Use freely for any purpose including commercial projects, keep the copyright notice and patent grant.

Wtf does this do

Prepack is a tool for making JavaScript code run faster. JavaScript is the programming language that powers most interactive websites and apps. When a program starts up, it often does a lot of repetitive setup work. Prepack reads a JavaScript file ahead of time, figures out parts of that work in advance, and rewrites the file into a version that produces the same result while doing less work when it actually runs. The makers describe it as a partial evaluator: it pre-computes whatever it safely can before the code ever reaches the user. An important note in the README is that the project is paused. The team at Facebook that built it has set the work down, including a related React compiler effort, so there is little ongoing activity. The repository now lives under Facebook's archive account, which signals that it is no longer actively maintained. For people who still want to try it, the README explains how to install it as a command-line tool through the npm or yarn package managers. Once installed, you point it at a JavaScript file and it prints the optimized result to the screen or saves it to a new file. There are also separate plugins, maintained by other people, that connect Prepack to popular build tools such as Rollup, Webpack, and Parcel, as well as an editor extension for Visual Studio Code. The rest of the document is aimed at developers who want to work on Prepack itself. It walks through cloning the code, setting up the required tools, and the commands for building, checking, and testing it. It also explains how to run an interactive session, how to edit the project's website, which is stored in the same repository, and where to find contribution guidelines. Prepack is released under the BSD license with an additional patent grant.

Yoink these prompts

Prompt 1
Using Prepack, optimize a JavaScript file that builds a large lookup table at startup so the pre-computed table is baked into the bundle instead.
Prompt 2
How do I add the Prepack Webpack plugin to an existing project to automatically optimize my output bundle at build time?
Prompt 3
Show me a before-and-after example of what Prepack does to a simple JavaScript file that computes a constant during initialization.
Prompt 4
What kinds of JavaScript patterns does Prepack NOT handle well, and when should I avoid using it?

Frequently asked questions

wtf is prepack?

An archived Facebook tool that pre-evaluates JavaScript before it runs, pre-computing constants and startup work so the optimized version loads faster. No longer actively maintained.

What language is prepack written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js.

What license does prepack use?

Use freely for any purpose including commercial projects, keep the copyright notice and patent grant.

How hard is prepack to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is prepack for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.