I do have a successful config with a Vu3 app with the following
export default defineConfig(({ mode }) => {
return {
plugins: [vue()],
build: {
outDir: '../../public/dist',
emptyOutDir: true,
manifest: true,
rollupOptions: {
input: path.resolve(__dirname, 'src/main.js'),
}
},
server: {
strictPort: true,
port: 5133,
hmr: {
host: 'localhost'
}
},
}
})
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
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
ssr: false,
devServer: {
port: 5233,
host: 'localhost',
},
vite: {
server: {
strictPort: true,
hmr: {
host: 'localhost'
}
}
},
})
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. 🤔