neeonline
300
6
Mix

Hot Reload (Vue) with Valet (SSL)

Posted 2 months ago by neeonline

I can't figure out how to make the browser sync/hot reload to work with Valet. I'm using https Valet domains, I tried everything...

This is my mix config:

let siteName = 'mysite';
let valetDomain = '.test';
let userName = 'macuser';

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .tailwind()
    .browserSync({
      proxy: 'https://' + siteName + valetDomain,
      host: siteName + valetDomain,
      open: 'external',
      port: 8000,
      https: {
        key:
          '/Users/' +
          userName +
          '/.config/valet/Certificates/' +
          siteName +
          valetDomain + '.key',
        cert:
          '/Users/' +
          userName +
          '/.config/valet/Certificates/' +
          siteName +
          valetDomain + '.crt'
      }
    });

The changes are not reflected. So I changed the blade template to load the css/js via {{ mix('/js/app.js') }} and then it is trying to load assets from http://localhost:8080 and not https://mysite.test:8000/js/app.js

Any help is appreciated.

Please sign in or create an account to participate in this conversation.