Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
In the context of a theme extension... I have multiple js files in my assets folder. Can I reference other files from one file using liquid? For example, if I have an app.js file and a number.js file. Can I do this from my app.js file?
For instance
app.js
const script = document.createElement('script');
script.type = 'text/javascript';
script.setAttribute('src', "{{ 'number.min.js' | asset_url }}");
script.onload = function () {
...
..
.
};
This is Noah from PageFly - Shopify Page Builder App
Hi @Elías Yes you can. Then to use the file, you just need to use this code to call that file:
Hope my solution will help you resolve the issue.
Best regards,
Noah | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Hello,
Did you read the question ? the OP is asking how to import a JS file from another JS file.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025