mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

Server-side code should be compiled ahead of time #2164

Open ziir opened 2 years ago

ziir commented 2 years ago

Related to:

At the moment, server-side code is compiled w/ Babel on the fly via @babel/register. This is usually not recommended for production, as it slows down startup time & general performance, obscures the compiled code output..

A more usual, predictable, though slightly more complex setup than the current one, would be to compile server-side source files with Babel ahead of time, as part of the main build script, and use the compiled server/base.js file to run the server.

bin/server.js & related npm scripts could be left unchanged, except for the removal of @babel/register. The Babel configuration would need to be tweaked to include dynamic-import-node plugin.

┆Issue is synchronized with this Jira Task

KevinMind commented 6 months ago

Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDFRNT-86