Add JS to all webform I have a Drupal 9 custom theme and would like to attach a JS file on the webform.
Adding JS file in themename.libraries.yml does not work. 
webform:
  js:
    theme:
      js/webform.min.js: {}

What is the right way to attach a JS file to the other module(webform)?
Adding lines to themename.libraries.yml is not enough to add the JS, you just declared a library doing this.
Now if you want to use that library on all your theme pages, you need to add in themename.info.yml
libraries:
  - themename/webform

But if you just need to attach the library to your forms, you can use  the hook_form_alter, target your webform ids and write
$form['#attached']['library'][] = 'themename/webform';