Using vite for laravel mails, Vite::content in dev mode #51721
Unanswered
Coding-Kiwi
asked this question in
Q&A
Replies: 1 comment
-
While you are working on your emails you can use the vite watch mode which rebuilds you js and css on changes instead of serving them via websockets. You can also create a separate vite config only for emails and pass it as a parameter on a new npm command and use that in watch mode for email. You can run multiple npm commands using the package Example: ...
"scripts": {
"dev": "concurrently \"npm run vite:dev\" \"npm run vite:mail\"",
"vite:dev": "vite",
"vite:mail": "vite build -c vite.mail.config.js --watch",
...,
}
... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use scss in my app and to have my mails sent by laravel themed too, I used this
to build and copy the css to the required location.
Now I want to use vite and as stated in the docs there is a way to include raw content https://laravel.com/docs/11.x/vite#inline-assets
This only works when the manifest.json is in the public/build directory which is not the case when running vite in dev mode. This is only the case when I manually run the production build command.
Is there a better way to do this?
Beta Was this translation helpful? Give feedback.
All reactions