Hello, still very new to Laravel and especially to Vite.
I was building my site, lazily just including the whole tailwind library from a CDN but I can't do that in an email template it seems. So I am trying to get my head around Vite (which I believe will solve my problem with emails?)
I have Vite installed and running fine in my dev environment, but when the application sends an email the paths to the CSS files don't work as Vite is including some interesting links. I'm using Maitrap to test these emails and the source shows:
<script type="module" src="http://[::1]:5173/@vite/client"></script><link rel="stylesheet" href="http://[::1]:5173/resources/css/app.css" /><script type="module" src="http://[::1]:5173/resources/js/app.js"></script>
I'm wondering if this is Homestead configuration that is incorrect. I'm using Homestead in a Windows 10 environment. My Homestead yaml looks like:
---
ip: "192.168.10.10"
memory: 16096
cpus: 4
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: h:/Sites/Laravel
to: /home/vagrant/Code
sites:
- map: flashcards.elliotwrigley.test
to: /home/vagrant/Code/elliotwrigley/public
mariabd: true
variables:
- key: APP_ENV
value: testing
databases:
- flashcards
ports:
- send: 5173
to: 5173
My Vite config:
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
],
});
Thanks for any help in advance!