DEV Community

Cover image for Keep useful build work after closing the terminal
KhaledSalem
KhaledSalem

Posted on

Keep useful build work after closing the terminal

A small Ionify walkthrough: run a build, let the process exit, then return to the same app without deleting its local state.

You shouldn’t have to leave a terminal running just to preserve useful build work. In an existing, supported Ionify project, start with two separate invocations of the same build command. Keep the local state between them. Then change a visible label and check the built app. The point is practical: distinguish work that survives a process restart from work that exists only while a process is alive.

Why should a frontend developer care?

Closing a terminal should not make you lose the opportunity to reuse valid local work. This exercise gives you a small way to evaluate that boundary without replacing your team’s workflow or claiming a remote-cache result.

1. Build an unchanged baseline

Use an existing app configured according to the supported setup. Record the installed Ionify version, checkout revision, lockfile and exact command. This is not a standalone installation recipe.

pnpm exec ionify build
# Let this process exit. Keep the project's local state.
pnpm exec ionify build
Enter fullscreen mode Exit fullscreen mode

Run each invocation to completion in a fresh process; for the second, open a new terminal in the same checkout. Preserve .ionify and the output directory, including workspace-root state in a monorepo. Do not change packages or configuration between builds. Check the production output after each invocation.

2. Make one visible source edit

In a component that your app imports and renders, replace the original button with the second version:

// Before
<button id="save-button">Save</button>
// After
<button id="save-button">Save draft</button>
Enter fullscreen mode Exit fullscreen mode

These are illustrative JSX fragments; integrate one at a time into your existing component. Run the same build command in another fresh process, keeping local state. Do not add a different mode flag for the edited run.

3. Serve and inspect the production app

Use your project’s static preview setup against the generated output, not the dev server. The CLI’s default build output is dist; if your command explicitly selects another directory with --out-dir, serve that directory consistently. A simple local preview for a root-page app is:

python3 -m http.server 4173 --bind 127.0.0.1 --directory dist
Enter fullscreen mode Exit fullscreen mode

Open http://127.0.0.1:4173/. Inspect #save-button and confirm its visible text is Save draft. A static Python server does not add SPA routing fallback; use your app’s normal preview server for routes that require it.

Expected: the new label appears. Observed: fill this in from your browser. No successful run, timing or internal work count is asserted by this walkthrough.

If the old label appears, preserve the evidence. Check which directory and origin are served and whether the browser reused an earlier response. A prior label experiment saw same-origin 304 reuse display the old label while a fresh origin serving the retained-state output displayed the new one. A new preview origin can help distinguish serving/browser-cache behavior; it is not evidence of universal cache correctness.

Keep the record small and honest

Installed version / checkout / command:
Same checkout and lockfile: yes/no
Engine state and output retained: yes/no
New process for each invocation: yes/no
Configuration unchanged: yes/no
Expected label / observed label:
Served directory / URL / browser-cache observations:
Elapsed observations, if actually collected:
Enter fullscreen mode Exit fullscreen mode

Timing alone cannot reveal which internal work was skipped. Use only diagnostics the installed release supports. For a fresh-state comparison, keep this fixture intact and use a separate disposable copy. Local persistence and cross-machine reuse need different evidence.

Which part of returning to your project still makes you wait? Share the boundary you tested, even if the result was unfavorable.

Cover description: “The second build”: a terminal window floats above retained ivory and amber work tiles, with a faded window behind it. Conceptual illustration.

Conceptual illustration created with AI assistance for Ionify.

Top comments (0)