Created
November 9, 2019 19:24
-
-
Save antonioribeiro/fddc8a7accf23ae013a13000c78fbfd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in your .env file, split APP_URL to extract protocol and hostname | |
APP_PROTOCOL=https | |
APP_HOSTNAME=myapp.test | |
APP_URL="${APP_PROTOCOL}://${APP_HOSTNAME}" | |
// install dotenv | |
npm install dotenv | |
// load it in your webpack.mix.js | |
require('dotenv').config() | |
// configure the LiveReload plugin to use the protocol && hostname you have on your .env file | |
new LiveReloadPlugin({ | |
protocol: process.env.APP_PROTOCOL | |
hostname: process.env.APP_HOST | |
}), | |
// Change your template to use app.url instead | |
@if(app()->environment() === 'local') | |
<script src="{{ config('app.url') }}:35729/livereload.js"></script> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment