How to require external libraries in a component helper file?

No, you shouldn’t need to do that.

I note the syntax is still in the spec: discourse/spec/models/theme_spec.rb at c8f4f7c235ca38b39d4b66bf9e1305410e36815e · discourse/discourse · GitHub