I’m starting to integrate gulp with my WP site for tasks like minifying js and compiling SASS. I’m not using the minified output files in development, but want to use for production.
Right now, I’m using in functions.php the wp_enqueue_script function to queue all my .js files. However, once I integrate minified, concatenated .js files in production, how do I do this within WP so that in development I’m queueing the non-minified files, but in production, I’m using the minified files?
Is it a matter of detecting the environment I’m in in functions.php and queueing the files based on that? Or is there another way–maybe more elegant?– to do this?
- The topic ‘How to queue minified files in production, but not development’ is closed to new replies.