diff --git a/esbuild.js b/esbuild.js index fb26fa65..cf80d2d2 100644 --- a/esbuild.js +++ b/esbuild.js @@ -76,7 +76,9 @@ const prebuild = () => { copyFiles("cypress/pages", "*.html", "build"); }; -const files = fs.readdirSync("src/js").filter((file) => file.endsWith(".js")); +const files = fs + .readdirSync("src/js/", { recursive: true }) + .filter((file) => file.endsWith(".js")); if (process.env.NODE_ENV === "development") { prebuild(); @@ -95,17 +97,19 @@ const prodOptions = { files.forEach((file) => { const baseName = path.basename(file, ".js"); + const dir = path.dirname(file); + if (process.env.NODE_ENV === "development") { esbuild.build({ ...devOptions, entryPoints: [`src/js/${file}`], - outfile: `build/js/${baseName}.min.js`, + outfile: `build/js/${dir}/${baseName}.min.js`, }); } else { esbuild.build({ ...prodOptions, entryPoints: [`src/js/${file}`], - outfile: `dist/js/${baseName}.min.js`, + outfile: `dist/js/${dir}/${baseName}.min.js`, }); } }); diff --git a/src/basic-kyc.html b/src/basic-kyc.html index c1dc7c85..436e8840 100644 --- a/src/basic-kyc.html +++ b/src/basic-kyc.html @@ -28,8 +28,8 @@ - - + + diff --git a/src/biometric-kyc.html b/src/biometric-kyc.html index e3f691e5..dbb6ed4b 100644 --- a/src/biometric-kyc.html +++ b/src/biometric-kyc.html @@ -34,8 +34,8 @@ href="https://cdn.smileidentity.com/js/v1.0.0-beta.23/smart-camera-web.js" /> - - + + diff --git a/src/ekyc.html b/src/ekyc.html index 5dce9513..5787ef27 100644 --- a/src/ekyc.html +++ b/src/ekyc.html @@ -28,8 +28,8 @@ - - + + diff --git a/src/js/consent-screen.js b/src/js/components/ConsentScreen.js similarity index 100% rename from src/js/consent-screen.js rename to src/js/components/ConsentScreen.js diff --git a/src/js/totp-consent-app.js b/src/js/components/TotpConsentApp.js similarity index 100% rename from src/js/totp-consent-app.js rename to src/js/components/TotpConsentApp.js diff --git a/src/smartselfie-auth.html b/src/smartselfie-auth.html index e0109fb0..72ad5e4c 100644 --- a/src/smartselfie-auth.html +++ b/src/smartselfie-auth.html @@ -34,7 +34,6 @@ href="https://cdn.smileidentity.com/js/v1.0.0-beta.23/smart-camera-web.js" /> -