Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 365 forks source link

Is there a way to get chunking / code-splitting prefixed with the store's CDN url? #1089

Open adrianocr opened 4 years ago

adrianocr commented 4 years ago

I got chunking to work across my project and then deployed the theme only to realize that the URL /chunk-name-here.js means nothing to the browser. It needs to be https://cdn.shopify.com/s/files/1/01112/41117/4702/assets/chunk-name-here.js or something like that.

So has anyone gotten this to work? I wouldn't even mind providing the cdn url manually.

chefjuanpi commented 4 years ago

seems you're manually calling your scripts and not using the build function. Remember, write the js files on /src/scripts, after that during build the scripts will be build and set on assets directory, to call them slack will create the file /snippets/script-tags.liquid file on dist. this file contains the proper way to call files on liquid