From 188e9e415501238ef8bc9fb5a42b0d810bb54618 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 17 Jul 2023 11:38:16 -0400 Subject: [PATCH] fix: need to fetch active config after defining options --- vite.config.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vite.config.js b/vite.config.js index d73c924..a1229f2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,11 +5,6 @@ import { resolve } from "path"; const config = {}; -const currentConfig = config[process.env.LIB_NAME]; -if (currentConfig === undefined) { - throw new Error("LIB_NAME is not defined or is not valid"); -} - ["background", "bootloader", "bridge", "crypto", "cryptoLoader"].forEach( (item) => { config[item] = { @@ -19,6 +14,11 @@ if (currentConfig === undefined) { }, ); +const currentConfig = config[process.env.LIB_NAME]; +if (currentConfig === undefined) { + throw new Error("LIB_NAME is not defined or is not valid"); +} + export default defineConfig({ build: { outDir: "lib",