elementor / hello-theme-child

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Idea] Add capability / compile pipeline for theme JS files

drawcard opened this issue · comments

Occasionally, a theme author might like to add a JS library or some other custom JS code to the site theme. At the moment, this is a manual process which means editing functions.php, adding in a wp_enqueue_script() ref and then loading up the JS that way.

I was wondering if Elementor devs are considering having that capability already set up, so that there's less thinking when a theme editor wants to add a JS script?

I'm trying to think of a way to do it without having to have a blank dummy file present (eg. theme.js).

Perhaps it could be just a grunt instruction instead to watch a JS folder, minify and compile it, and then export out theme.min.js which is then toggled on or off in functions.php... Kind of how SCSS is compiled to CSS on https://github.com/elementor/hello-theme.

This isn't a big deal if non-implementable, it's just an idea I've had kicking around in my head for a while since I've been using Elementor Hello on other sites 😄

hello-theme-child is a simplified example of a child theme. You can add any css/js/php to the theme.

It's part of the WordPress theme specification, therefore we suggest reading WordPress dev resources.

The Child Themes handbook is a good place to start.