-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backend integration in development #2908
Comments
In my case I would love to use Vite to replace Webpack in our PHP app, for faster build times during development. Right now that's not an option. Most pages have their own entrypoints. We scan manifest files generated by Webpack in both development and production mode to render out all the The Alternative option stated above - generating |
Hi @RentecTravis, for your information, I have meanwhile created a plugin for Vite : with this config import symfonyPlugin from "vite-plugin-symfony";
// vite.config.js
export default defineConfig({
plugins: [
symfonyPlugin(),
],
build: {
rollupOptions: {
input: {
app: "./app.js"
},
},
}
}); you get this in dev : {
"isProd": false,
"viteServer": {
"origin": "http://localhost:3000",
"base": "/build/"
},
"entryPoints": {
"app": {
"js": [
"http://localhost:3000/build/app.js"
]
},
}
} and this in prod {
"isProd": true,
"entryPoints": {
"app": {
"js": [
"/build/app.2cdc77ca.js"
],
"css": [
"/build/app.8241fdaf.css"
],
"preload": [
"/build/index.es.09ea6271.js"
]
}
} his name is |
Thanks @lhapaipai, that does help. It looks like your package may get us a significant part of the way there. It's wonderful that the output is so similar to the |
Of course, it would still be wonderful to have the |
if you are using Symfony, you can try pentatrion/vite-bundle it works in the same way that webpack encore but with vite. you can also import image assets... |
@lhapaipai thank you. We're not using Symfony, just vanilla PHP (it's an old application) to do the same thing that |
I'm not sure what this feature request is proposing. The manifest is only generated in build, I'm not sure how it's related to <script type="module" src="http://localhost:3000/@vite/client"></script>
<script type="module" src="http://localhost:3000/main.js"></script> which
Can you elaborate why the Vite dev client should delete the built manifest? |
hi @bluwy, this issue is solved with https://github.com/lhapaipai/vite-plugin-symfony |
I think it's good to fix this through a Vite plugin for now as not all integrations rely on the manifest behaviour like Symfony to work. Closing in favour of the plugin. |
Clear and concise description of the problem
if I want to use vite with my backend integration, I don't know if vite client is running and I have to take :
or if I have to use files from
manifest.json
:As a developer, I think it would be interesting to know if files documented by manifest.json are out of date when I'm running the vite client :
http://localhost:3000/@vite/client
Suggested solution
delete the
manifest.json
when I'm running the vite dev client. so I know that I have to callAlternative
update the
manifest.json
with dev informations when I'm running the vite dev client.The text was updated successfully, but these errors were encountered: