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.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025