Fix node_modules validation when building extensions.
Review Request #11608 — Created May 20, 2021 and submitted
When building extension packages against a production install of a
consuming application, it was likely that a
call in the app's
settings.pywould have path validation enabled,
node_modules, and that the validation would fail.
In reality, we didn't care much about the presence of this path at this
stage, since the packaging process would be managing its own
node_modules. Rather than make the consuming app jump through hoops,
we now have a special environment variable that can be set to force
validation to be turned off. This mirrors the behavior of applications
using Djblets pre-2.0.
On top of this, we also explicitly define
NODE_PATHto point to the
managed copy, ensuring it will be used instead of another, and avoiding
other lookup issues that could occur.
Tested building extensions against both a Review Board development server
and a production server.
Tested both initial builds (without a pre-populated
and with a repeated build.