From ee5b01adf6cb870617140195a41ce7dc37bf81a4 Mon Sep 17 00:00:00 2001 From: tetrode Date: Mon, 6 Nov 2017 15:01:37 +0100 Subject: [PATCH] Also remove any JS after a comment in the form of /*DEV*/ Using this to log to the console during development, e.g. /*DEV*/ console.log("debug information"); Anything after the /*DEV*/ string is removed on minification. --- src/JS.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/JS.php b/src/JS.php index d553c099..b47533a6 100644 --- a/src/JS.php +++ b/src/JS.php @@ -208,6 +208,9 @@ public function execute($path = null) */ public function stripComments() { + // /*DEV*/ style comments + $this->registerPattern('/\/\*DEV\*\/.*$/m', ''); + // single-line comments $this->registerPattern('/\/\/.*$/m', '');