Importing js files through app.js file

[ad_1]

I’ve enqueued my custom JavaScript file in functions.php, but I want to divide up my js into more files. My current path to app.js is

/assets/js/app.js

I wanted to create a new folder containing files

/assets/js/partials/custom.js

I try and import the custom.js file into the app.js file, but I just get an error if I try to call a function from custom.js.

How can I achieve this within WordPress without having to enqueue like 10 different JavaScript files?

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer