• Hello, good people at Nelio!

    We started using Nelio on our site and we really like it so far!

    I just have one question for you:

    I see Nelio requires regenerator-runtime but I am not sure whether this is needed for sites that only support modern browsers. If it is really not needed in such cases, would it be possible to add an option to disable the dependency?

    Or is there a filter we could use to remove the dependency without asking for extra settings?

    Thank you for your time,

    Demetris Kikizas

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Aguilera

    (@davilera)

    Hi! You could add the following snippet on your site:

    add_action(
      'wp_enqueue_scripts',
      function() {
        global $wp_scripts;
        $scripts = array_keys( $wp_scripts->registered );
        foreach ( $scripts as $script ) {
          $deps = $wp_scripts->registered[ $script ]->deps;
          $deps = array_values( array_diff( $deps, [ 'regenerator-runtime' ] ) );
          $wp_scripts->registered[ $script ]->deps = $deps;
        }
      },
      PHP_INT_MAX
    );
    

    Essentially, the previous snippet iterates over all your registered scripts and removes the “regenerator-runtime” dependency from their respective list of dependencies.

    I hope this helps!

    Oh, that’s great!

    Thank you very much for your help, David!

    Demetris

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dependency on regenerator-runtime’ is closed to new replies.