Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit b7c73b1

Browse files
committed
Use non-minified scripts and styles if plugin installed via git (submodule)
1 parent 7d1e373 commit b7c73b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

php/class-plugin.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public function init() {
6666
* @param \WP_Scripts $wp_scripts Instance of \WP_Scripts.
6767
*/
6868
public function register_scripts( \WP_Scripts $wp_scripts ) {
69-
$min = ( SCRIPT_DEBUG ? '' : '.min' );
69+
$is_git_repo = file_exists( dirname( dirname( __FILE__ ) ) . '/.git' );
70+
$min = ( SCRIPT_DEBUG || $is_git_repo ? '' : '.min' );
7071

7172
$handle = 'customize-snapshots';
7273
$src = $this->dir_url . 'js/customize-snapshots' . $min . '.js';
@@ -92,7 +93,8 @@ public function register_scripts( \WP_Scripts $wp_scripts ) {
9293
* @param \WP_Styles $wp_styles Instance of \WP_Styles.
9394
*/
9495
public function register_styles( \WP_Styles $wp_styles ) {
95-
$min = ( SCRIPT_DEBUG ? '' : '.min' );
96+
$is_git_repo = file_exists( dirname( dirname( __FILE__ ) ) . '/.git' );
97+
$min = ( SCRIPT_DEBUG || $is_git_repo ? '' : '.min' );
9698

9799
$handle = 'customize-snapshots';
98100
$src = $this->dir_url . 'css/customize-snapshots' . $min . '.css';

0 commit comments

Comments
 (0)