From e9a14811a65705009ab01d694f77266ee59c7222 Mon Sep 17 00:00:00 2001 From: Richard van 't Hof Date: Mon, 2 Dec 2024 02:59:27 +0100 Subject: [PATCH] Added quick fix - if dummy folder is replaced with default dist location. --- src/index.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b5c75b8..4f609bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -289,7 +289,25 @@ export const cep = (opts: CepOptions) => { //@ts-ignore const filePath = config.build.rollupOptions.input[key]; const relativePath = path.relative(config.root, filePath); - const destPath = path.resolve(config.build.outDir, relativePath); + + const standardPath = '' + + const folderFix = (folder: string) => { + console.log('folder fix triggered.') + const dummy = 'dummy-non-existing-folder'; + const defaultDir = 'dist/cep/'; + if (folder == dummy) { + console.log('Dummy folder detected.'); + return 'dist/cep/'; + } + else { + console.log('Dummy not detected. returning folder: ' + folder); + return folder; + } + }; + + + const destPath = path.resolve(folderFix(config.build.outDir), relativePath); const panelHtmlFile = { type: "asset", source: devHtmlTemplate({