From 314384a3788f962c0acaa8a6e821e7464e87ef46 Mon Sep 17 00:00:00 2001 From: Paul Kilmurray Date: Fri, 7 Jun 2024 18:47:34 +0100 Subject: [PATCH] add js workers --- includes/Templates/Frontend.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/includes/Templates/Frontend.php b/includes/Templates/Frontend.php index 91490f4..9ff25e7 100644 --- a/includes/Templates/Frontend.php +++ b/includes/Templates/Frontend.php @@ -12,6 +12,7 @@ use WCPOS\WooCommercePOS\Services\Auth; use const WCPOS\WooCommercePOS\SHORT_NAME; use const WCPOS\WooCommercePOS\VERSION; +use const WCPOS\WooCommercePOS\PLUGIN_URL; /** * Frontend class. @@ -148,7 +149,15 @@ function ( $store ) { $initial_props = wp_json_encode( $vars ); $dev_bundle = 'http://localhost:8081/index.bundle?platform=web&dev=true&hot=false'; - // getScript helper and initialProps + /** + * Add path to worker scripts + */ + $idbWorker = PLUGIN_URL . 'assets/js/indexeddb.worker.js'; + $mmIdbWorker = PLUGIN_URL . 'assets/js/memory-mapped-indexeddb.worker.js'; + + /** + * getScript helper and initialProps + */ echo "" . "\n"; + /** + * The actual app bundle + */ if ( $development ) { // Development echo "" . "\n";