Skip to content

Fixes vite assets in dev mode#18831

Merged
riasvdv merged 1 commit into
6.xfrom
bugfix/dev-vite-assets
May 11, 2026
Merged

Fixes vite assets in dev mode#18831
riasvdv merged 1 commit into
6.xfrom
bugfix/dev-vite-assets

Conversation

@brianjhanson
Copy link
Copy Markdown
Contributor

After #18801 vite assets are broken when using the dev server because the vite server can't serve from the /legacy/ path. craftAsset will create a dev URL such as https://craft6-dev.ddev.site:5173/legacy/pluginstore/dist/images/craft.svg but the server doesn't know where to find /legacy/ assets. It expects everything to be in the configured publicDir directory. We can't just have the /resources/ directory be the public directory or vite will treat the js/ and css/files as static files.

In the end, this little middleware makes things work for the moment. We may want to revisit the whole structure here down the road

@brianjhanson brianjhanson requested a review from riasvdv May 11, 2026 19:47
@riasvdv riasvdv merged commit ce2a132 into 6.x May 11, 2026
18 checks passed
@riasvdv riasvdv deleted the bugfix/dev-vite-assets branch May 11, 2026 19:48
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