From fd0e0d8aae50b3d90dbb005a787d6948fc9cd245 Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Thu, 1 Aug 2024 11:33:45 +0300 Subject: [PATCH] Prevent stored config being parsed twice. Fixes lwsjs/local-web-server#176 --- index.js | 4 +++- lib/cli-app.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b9cb42c..9f2b6c1 100644 --- a/index.js +++ b/index.js @@ -277,7 +277,9 @@ class Lws extends EventEmitter { */ static async create (config) { const lws = new this(config) - await lws.loadStoredConfig() + if (!config._alreadyMerged) { + await lws.loadStoredConfig() + } /* attach the view */ lws.useView() diff --git a/lib/cli-app.js b/lib/cli-app.js index 4b5c4e2..616823a 100644 --- a/lib/cli-app.js +++ b/lib/cli-app.js @@ -167,6 +167,7 @@ class LwsCli { options = deepMerge(options, storedConfig, cliOptions) options.stack = stack options.view = view + options._alreadyMerged = true return options }