cli: fix node env not being set for backend dev

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-08-11 15:38:37 +02:00
parent f2ff3c5fb4
commit 72c228fdb8
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -26,6 +26,10 @@ export async function serveBackend(options: BackendServeOptions) {
isDev: true,
});
// Webpack only replaces occurrences of this in code it touches, which does
// not include dependencies in node_modules. So we set it here at runtime as well.
(process.env as { NODE_ENV: string }).NODE_ENV = 'development';
const compiler = webpack(config, (err: Error | undefined) => {
if (err) {
console.error(err);