Skip to content

[6.x] Fix vite dev for addons - #13241

Merged
jasonvarga merged 15 commits into
masterfrom
addons-vite-dev
Dec 3, 2025
Merged

jasonvarga merged 15 commits into
masterfrom
addons-vite-dev

Conversation

@jasonvarga

@jasonvarga jasonvarga commented Dec 3, 2025

Copy link
Copy Markdown
Member

This PR gets npm run dev working for addons.

Currently we force vite build --watch. This isn't necessary anymore.

The only requirement is that you're using a CP build that has HMR available. Either:

  • The dev cp build (artisan vendor:publish --tag=statamic-cp-dev) which you should have this anyway if for Vue devtools to work.
  • You also have vite running for the cp itself. (e.g. if you're also working on the core)

If you run npm run dev and you see an error about __VUE_HMR_RUNTIME__ is not defined when saving a file, that's because you aren't doing one of those. I've made it so you will see a warning.

image

Your addon will still compile and work - you'll just need to manually refresh.

@jasonvarga
jasonvarga marked this pull request as ready for review December 3, 2025 18:15
@jasonvarga
jasonvarga merged commit 404a062 into master Dec 3, 2025
10 checks passed
@jasonvarga
jasonvarga deleted the addons-vite-dev branch December 3, 2025 18:21
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