fix(web): make sync-assets script cross-platform (#25760)#25790
Merged
Conversation
The prebuild step used `rm -rf` and `cp -r`, which fail on Windows (`'rm' is not recognized`). Replace with an inline Node one-liner using fs.rmSync / fs.cpSync so the build works on Windows, macOS, and Linux without adding a dependency.
Contributor
🔎 Lint report:
|
Collaborator
austinpickett
approved these changes
May 14, 2026
Collaborator
|
This works, but we might want to look at adding vite-plugin-static-copy which will let us define this in the config, and apart of the vite startup. // vite.config.ts
import { viteStaticCopy } from 'vite-plugin-static-copy'
export default defineConfig({
plugins: [
viteStaticCopy({
targets: [
{ src: 'node_modules/@nous-research/ui/dist/fonts', dest: 'fonts' },
{ src: 'node_modules/@nous-research/ui/dist/assets', dest: 'ds-assets' }
]
})
]
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
web/package.jsonsync-assets script used Unixrm -rfandcp -r, which fail on native Windows. Replaces with Node.js fs API calls (Node ≥16.7) — same behavior on POSIX, works on Windows, no new deps.Salvage of #25760 by @HxT9.