Add a new env item for webpack

This commit is contained in:
Pig Fang 2019-07-23 17:34:04 +08:00
parent 777fc23151
commit 8552d2f7b5
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@
# Be sure to disable debug at production environment!
APP_DEBUG = false
APP_ENV = production
WEBPACK_ENV = production
# Database Configuration
DB_CONNECTION = dummy

View File

@ -10,7 +10,7 @@ use Illuminate\Support\Str;
if (! function_exists('webpack_assets')) {
function webpack_assets(string $relativeUri): string
{
if (app()->environment('development')) {
if (env('WEBPACK_ENV', 'production') == 'development') {
// @codeCoverageIgnoreStart
$host = parse_url(url('/'), PHP_URL_HOST);
return "http://$host:8080/$relativeUri";