diff --git a/src/module.mjs b/src/module.mjs index f5b6c3086b..b08d1a0710 100644 --- a/src/module.mjs +++ b/src/module.mjs @@ -144,8 +144,10 @@ async function addBuildTemplates(nuxt, options) { entry: join(nuxt.options.appDir, 'entry'), runOptions: options.runOptions, ssr: nuxt.options.ssr, - ignorePerformance: !options.detection.performance, - ignoreBattery: !options.detection.battery, + ignore: { + battery: !options.detection.battery, + performance: !options.detection.performance + }, performanceMetrics: JSON.stringify(options.performanceMetrics || {}), supportedBrowserDetector } diff --git a/src/runtime/tmpl/entry.mjs b/src/runtime/tmpl/entry.mjs index b53e9ffc6a..ec124dce7c 100644 --- a/src/runtime/tmpl/entry.mjs +++ b/src/runtime/tmpl/entry.mjs @@ -43,7 +43,7 @@ function client () { document.documentElement.classList.remove('nuxt-speedkit-reduced-view'); - <% if (!options.ignoreBattery) { %> + <% if (!options.ignore.battery) { %> try { if (!force) { await hasBatteryPerformanceIssue(videoBlob) @@ -95,7 +95,7 @@ function client () { setup(<%= options.performanceMetrics %>); - if(('__NUXT_SPEEDKIT_AUTO_INIT__' in window && window.__NUXT_SPEEDKIT_AUTO_INIT__) || ((<%= !options.ignorePerformance %> && hasSufficientPerformance()) && supportedBrowser)) { + if(('__NUXT_SPEEDKIT_AUTO_INIT__' in window && window.__NUXT_SPEEDKIT_AUTO_INIT__) || ((<%= !options.ignore.performance %> && hasSufficientPerformance()) && supportedBrowser)) { initApp(); } else { setupSpeedkitLayer(layerEl, supportedBrowser)