It's possible to use the preprocessor to join multiple JS files, but we've been moving away from that as much as possible recently.

With the script precompiler enabled, though, there isn't very much per-script overhead for scripts loaded via the subscript loader at startup. And if the new code isn't likely to be needed during startup, you can use the subscript loader to lazily load it the first time it's needed, rather than at startup. So I'd recommend you go one of those two routes.

On Wed, Jul 05, 2017 at 06:30:02PM -0700, [email protected] wrote:
I'm working on a new feature which will add a new JS class.

I can grow the main file (mozIntl.js) or add it in a separate file 
(mozIntlLocale.js).

For readability, I think it would be nicer if I could add it as a separate file 
(I like to keep my files under 500 lines), but I don't want us to pay the 
runtime price of loading the file via JSM or XPCOM interfaces.

Is there anything like a RollupJS in our build system? Or is there any plan to 
add it?

--
Kris Maglione
Senior Firefox Add-ons Engineer
Mozilla Corporation

Of all the preposterous assumptions of humanity over humanity, nothing
exceeds most of the criticisms made on the habits of the poor by the
well-housed, well-warmed, and well-fed.
        --Herman Melville

_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to