Skip to content

Commit

Permalink
pre-initialize pdp
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhipster committed Nov 27, 2024
1 parent e9bfa15 commit d3e933b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions scripts/initializers/pdp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint import/no-cycle: [2, { maxDepth: 1 }] */

import { initializers } from '@dropins/tools/initializer.js';
import {
initialize,
Expand Down
4 changes: 3 additions & 1 deletion scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ async function loadEager(doc) {
if (document.body.querySelector('main .product-details')) {
pageType = 'Product';

// initialize pdp
import('./initializers/pdp.js');

// Preload PDP Dropins assets
preloadFile('/scripts/initializers/pdp.js', 'script');
preloadFile('/scripts/__dropins__/storefront-pdp/api.js', 'script');
preloadFile('/scripts/__dropins__/storefront-pdp/render.js', 'script');
preloadFile('/scripts/__dropins__/storefront-pdp/containers/ProductHeader.js', 'script');
Expand Down

0 comments on commit d3e933b

Please sign in to comment.