Skip to content

Commit

Permalink
fix(entry): added ignore object
Browse files Browse the repository at this point in the history
  • Loading branch information
ThornWalli committed Sep 13, 2023
1 parent 5d5332e commit 54ceb68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/module.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/tmpl/entry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 54ceb68

Please sign in to comment.