Use cdn URL in theme app extension

Divy_tatva
Shopify Partner
32 1 9

Hello

 

From where I can add my cdn URL in theme app extension ?

 

When i added CDN in block files it's showing me this suggestion

"AssetSizeJavascript: JavaScript on every page load exceeds compressed size threshold (10000
Bytes), consider using the import on interaction pattern."

" RemoteAsset: Asset should be served by the Shopify CDN for better performance"

 

 

 

 

Reply 1 (1)

deporter-shopst
Shopify Partner
1 0 0

I am also getting this warning, my issue is when I use lazy loading in the react project and deploy to the theme app extension on shopify, the lazy loaded module is trying to load from the shop assets folder rather than the Shopify CDN, does anyway know a good way to manage this? Either by making the module load relative to the js file that is triggering the load of the next module or by somehow passing the cdn url into the project in a dynamic way that would update if the shopify cdn url changes. The CDN url has the following structure: https://cdn.shopify.com/extensions/<extension-id>/<extension-package-version>/assets/<file>.js