Skip to content

Commit

Permalink
Use SCRIPT_DEBUG instead of WP_DEBUG to indicate dev build of Workbox…
Browse files Browse the repository at this point in the history
… should be used
  • Loading branch information
westonruter committed Jun 11, 2019
1 parent 3988006 commit 8686f59
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function get_script() {
$current_scope = wp_service_workers()->get_current_scope();
$workbox_dir = 'wp-includes/js/workbox/';

if ( WP_DEBUG ) {
if ( SCRIPT_DEBUG ) {
// Load with importScripts() so that source map is available.
$script = sprintf(
"importScripts( %s );\n",
Expand All @@ -67,7 +67,7 @@ public function get_script() {
}

$options = array(
'debug' => WP_DEBUG,
'debug' => SCRIPT_DEBUG, // When true, the dev builds are loaded. Otherwise, the prod builds are used.
'modulePathPrefix' => PWA_PLUGIN_URL . $workbox_dir,
);
$script .= sprintf( "workbox.setConfig( %s );\n", wp_service_worker_json_encode( $options ) );
Expand Down

0 comments on commit 8686f59

Please sign in to comment.