From 8552d2f7b59bd07455e6786569147b994d74047b Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Tue, 23 Jul 2019 17:34:04 +0800 Subject: [PATCH] Add a new env item for webpack --- .env.example | 1 + app/helpers.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index f7bac5a6..6b708f29 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/app/helpers.php b/app/helpers.php index fc3af916..eb44268c 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -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";