Hi @hamirmahal, did you have a particular implementation in mind? At the moment, we don't have a good way of doing this, so my suggestion would be to use a bundler to generate a single file at build time. In the future, we'd like to make that easier - there are some workarounds some tooling uses based on web_accessible_resources but this isn't ideal and probably isn't something we would encourage.
As for TypeScript, we generally try to avoid that in samples as it adds an extra layer for developers to understand - I think one or two TypeScript samples wouldn't be a bad idea though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally posted by: oliverdunk
Hi @hamirmahal, did you have a particular implementation in mind? At the moment, we don't have a good way of doing this, so my suggestion would be to use a bundler to generate a single file at build time. In the future, we'd like to make that easier - there are some workarounds some tooling uses based on
web_accessible_resourcesbut this isn't ideal and probably isn't something we would encourage.As for TypeScript, we generally try to avoid that in samples as it adds an extra layer for developers to understand - I think one or two TypeScript samples wouldn't be a bad idea though.
Originally posted by: hirehamir
Hello @oliverdunk, thanks for the quick response. Matching developer expectations as much as possible would be ideal.
If
"just worked" in
contentScript1.jsandcontentScript2.js, that'd be great.Which bundler do you recommend for someone prioritizing type safety, ease of use, and simplicity?
Originally posted by: oliverdunk
Definitely agreed that it would be nice to support an import like that. Unfortunately, it isn't something we support today.
All bundlers are good for different reasons - we don't have a standard recommendation so feel free to try a few :)