addons icon indicating copy to clipboard operation
addons copied to clipboard

Server-side code should be compiled ahead of time

Open ziir opened this issue 2 years ago • 1 comments

Related to:

  • https://github.com/mozilla/addons/issues/2163
  • https://github.com/mozilla/addons-frontend/pull/11593

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

ziir avatar Jun 22 '22 22:06 ziir

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

KevinMind avatar May 03 '24 18:05 KevinMind