How to access the entry.js file ala Vue3?
I do have a successful config with a Vu3 app with the following
This allows me to access the output of the Vue project from a PHP app thanks to the following endpoint
http://localhost:5133/main.js
---
In the Nuxt3 app, the entry point should be: http://localhost:5233/_nuxt/entry.js AFAIK
But I only have a 404 when visiting that one
This is the config of the Nuxt3 app
PS: the local app runs well if accessed directly (hence only the Nuxt app)
and the HMR script is also loaded properly from http://localhost:5233/_nuxt/@vite/client inside of the PHP app
I am mostly not sure if I'm missing some kind of additional config or using the wrong endpoint for the
entry.js
file. 🤔10 Replies
entry.js will have a hash attached for cache busting
example: https://www.lichter.io/_nuxt/entry.zAEaBz9c.js
you can disable these hashs if needed but this will remove cache busting
Oh that's why I saw some topics on the hashnames. 👌🏻
Makes sense indeed. Not being able to bust the cache is fine for my use case tbh.
Do you have a link as of how to do so by any luck? 💖
https://github.com/nuxt/nuxt/pull/26203 should help to show
GitHub
fix(vite): drop name prefix for client chunk file names by danielro...
🔗 Linked issue
resolves #13499
❓ Type of change
📖 Documentation (updates to the documentation or readme)
🐞 Bug fix (a non-breaking change that fixes an issue)
👌 Enhancement (improving an existi...
Okay so I tried with some updated settings
Works out well if accessed directly from Nuxt itself as seen on the image, but I do have an error when injected into the PHP view file.
I did
pnpm generate && pnpm run
for the Nuxt's dev server part.
The PHP view uses http://localhost/pizza
as path.

Not sure, tried with
but to no use. x)
also generates it properly
should I load it from somewhere else than
_nuxt
?
in the end, I'm just trying to have a webdev server working inside of PHP, nothing too intense (with no build step each time preferably haha)
I do load them this way into the PHP view
you need to add the runtimeConfig that is usually injected in nuxt
okay I got it!
Injecting the following into the PHP view indeed does the job.
I have a few errors regarding the router, not the biggest issue + Tailwind does not work. I guess I can fix those.
My primary concern now, is the fact that even if it works it requires some
pnpm generate && pnpm dev
each time to update the modifications on the PHP view.
While the JS dev server HMRs properly.
There's no way to have a proper reload without building the entire app each time? Here is the current config I do have.
Vue can just update the changes and send it down the wire but not Nuxt? 🥺