From cee5f3bc730dec1d7fd55f2c6aa65b97520ece97 Mon Sep 17 00:00:00 2001 From: Samuel Onyijne Date: Fri, 17 May 2019 02:08:01 +0100 Subject: [PATCH] added service worker for Prod --- assets/AppAsset.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/assets/AppAsset.php b/assets/AppAsset.php index 5920f1169..64348c5af 100644 --- a/assets/AppAsset.php +++ b/assets/AppAsset.php @@ -20,13 +20,19 @@ class AppAsset extends AssetBundle public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ - // 'css/site.css', - // 'assets/style.css' ]; public $js = [ - 'auto/app.js', - 'auto/js/chunk-vendors.js' + 'auto/app.js' ]; public $depends = [ ]; + + public function init () + { + parent::init(); + if(!YII_ENV_DEV){ + $this->js[] = 'auto/js/chunk-vendors.js'; + $this->js[] = 'auto/service-worker.js'; + } + } }