Skip to content

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

Open
arhimede wants to merge 1 commit into
mainfrom
merge-asset-pages-into-vite-build
Open

arhimede wants to merge 1 commit 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

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.

1 participant