-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Make BrowserSync work with Valet and https
- Loading branch information
1 parent
27a94c8
commit 01e3ea0
Showing
3 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,11 +74,11 @@ function determineSeparator(string $path): string { | |
} | ||
|
||
function replaceForWindows(): array { | ||
return preg_split('/\\r\\n|\\r|\\n/', run('dir /S /B * | findstr /v /i .git\ | findstr /v /i vendor | findstr /v /i '.basename(__FILE__).' | findstr /r /i /M /F:/ ":author :vendor :package Anotherkit anotherkit vendor_name vendor_slug [email protected]"')); | ||
return preg_split('/\\r\\n|\\r|\\n/', run('dir /S /B * | findstr /v /i .git\ | findstr /v /i vendor | findstr /v /i '.basename(__FILE__).' | findstr /r /i /M /F:/ ":author :vendor :package local-url Anotherkit anotherkit vendor_name vendor_slug [email protected]"')); | ||
} | ||
|
||
function replaceForAllOtherOSes(): array { | ||
return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|Anotherkit|anotherkit|vendor_name|vendor_slug|[email protected]" --exclude-dir=vendor ./* ./.github/* | grep -v ' . basename(__FILE__))); | ||
return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|local-url|Anotherkit|anotherkit|vendor_name|vendor_slug|[email protected]" --exclude-dir=vendor ./* ./.github/* | grep -v ' . basename(__FILE__))); | ||
} | ||
|
||
$gitName = run('git config user.name'); | ||
|
@@ -121,6 +121,7 @@ function replaceForAllOtherOSes(): array { | |
':vendor_slug' => $vendorSlug, | ||
':package_name' => $packageName, | ||
':package_slug' => $packageSlug, | ||
'local-url' => $folderName, | ||
'Anotherkit' => $packageName, | ||
'anotherkit' => $packageSlug, | ||
':package_description' => $description, | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
const mix = require("laravel-mix") | ||
// this is only needed to make BrowserSync work with Laravel Valet and https | ||
const homedir = require('os').homedir() | ||
const domain = 'local-url.test' | ||
|
||
mix.setPublicPath("public") | ||
mix.disableSuccessNotifications() | ||
mix | ||
.disableSuccessNotifications() | ||
.setPublicPath("public") | ||
.options({ | ||
processCssUrls: false, | ||
}) | ||
.browserSync({ | ||
proxy: 'https://' + domain, | ||
host: domain, | ||
open: 'external', | ||
https: { | ||
key: homedir + '/.config/valet/Certificates/' + domain + '.key', | ||
cert: homedir + '/.config/valet/Certificates/' + domain + '.crt' | ||
}, | ||
files: [ | ||
'assets/css/**/*.css', | ||
'assets/js/**/*.js', | ||
'site/templates/**/*.php', | ||
'site/snippets/**/*.php', | ||
], | ||
}) | ||
|
||
mix | ||
.js("src/js/main.js", "public/js") | ||
.postCss("src/css/main.css", "public/css", [ | ||
require("tailwindcss"), | ||
]) | ||
.options({ | ||
processCssUrls: false, | ||
}) | ||
.version() |