• I want to minimize requests on my site, so I’m bundling all my footer JS scripts into a single file.

    I dequeued the CF7 script in functions.php:
    wp_dequeue_script(‘contact-form-7’);

    Then I went ahead and bundled it into my main.js file with webpack:

    import ‘../wp-content/plugins/contact-form-7/includes/js/scripts.js’

    when I check main.js, the CF7 script IS inside there. But… CF7 frontend validation stops working. main.js is loaded in the footer in the same location in DOM where the above scripts.js was being loaded, so why would it not work?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Contact Form 7 script does not work when bundled into a combined JS file’ is closed to new replies.