Skip to content

Merge the two asset pages into one Vite build page - #32

Merged
arhimede merged 3 commits into
mainfrom
merge-asset-pages-into-vite-build
Oct 6, 2026
Merged

arhimede merged 3 commits into
mainfrom
merge-asset-pages-into-vite-build

Conversation

@arhimede

Copy link
Copy Markdown
Member

bundle-static-modules.md and manage-assets.md documented the same pipeline and contradicted each other — one said Vite and npm run build, the other said the npm script copied images "as is". A reader who found the wrong one first got the 1.2.0 answer.

They are now one page, kept at manage-assets.md so existing links keep working, retitled "Assets and the Vite build" in the nav. Three further findings are fixed in the merged text:

  • Destinations were wrong. viteStaticCopy sends fonts to public/fonts/ but images to public/images/app/. The old text said both were "copied as is", so a reader would write asset('images/logo.png') and get a 404. There is now a source-to-destination table and an asset() example for each kind, matching what the shipped layout already does.
  • The Node prerequisite was too loose. "Node.js v20" is satisfied by 20.0 through 20.18, which fail the install. package.json declares ^20.19.0 || >=22.12.0, and that is now what the page says.
  • The promised public cleanup does not happen. emptyOutDir: true sits at the top level of vite.config.js instead of under build, where Vite reads it, so it is ignored — and build.outDir lies outside root, which Vite will not empty without an explicit opt-in. The page now describes what the build actually does: it overwrites what it produces, stale files survive, delete the generated folders yourself if you need a clean result.

The last point is an upstream bug in dotkernel/light as well, tracked separately; this page can be revisited once that is fixed.

Signed-off-by: arhimede <julian@dotkernel.com>
@arhimede

Copy link
Copy Markdown
Member Author

@GeorgeCatalinStan please confirm this
also take a look at this
dotkernel/light#117

@arhimede

Copy link
Copy Markdown
Member Author

@bidi47 it was already a PR open on that matter....

@bidi47

bidi47 commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

there is still something we need to discuss before I change anything.
on dotkernel/light vite is currently configured to not empty the public folder before rebuilding.
but the docs in this repo (bundle-static-modules.md and manage-assets.md) claim that public is emptied (the classic setup where only changes in the src/App/assets folder were kept on npm build).

which setup is better? to empty public or not?

  • the advantage of not emptying it is that you don't lose any file by accident - update docs to reflect this
  • the advantage of emptying it is that public is cleaner

bidi47 added 2 commits October 6, 2026 14:56
Signed-off-by: bidi <bidi@apidemia.com>
Signed-off-by: bidi <bidi@apidemia.com>
@bidi47

bidi47 commented Oct 6, 2026

Copy link
Copy Markdown
Member
  • resolved conflict
  • verified vite config and behavior with dotkernel/light repo
  • added clarification related to non-asset files in public

@arhimede
arhimede merged commit 370ed55 into main Oct 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants