diff options
author | Sebastian <sebasjm@gmail.com> | 2023-04-21 10:42:39 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-04-21 10:42:39 -0300 |
commit | d61c5808bd2207178c95d34d4d2f7cb85f3991d9 (patch) | |
tree | 6b6d88db97e49bde2e259eb4c84628fb4e6b6234 /packages/anastasis-webui/build.mjs | |
parent | 821fbb0e2a7f45ad9aef1fa43e33a7aa36466501 (diff) | |
download | wallet-core-d61c5808bd2207178c95d34d4d2f7cb85f3991d9.tar.xz |
fix bulid
Diffstat (limited to 'packages/anastasis-webui/build.mjs')
-rwxr-xr-x | packages/anastasis-webui/build.mjs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/packages/anastasis-webui/build.mjs b/packages/anastasis-webui/build.mjs index ebe914541..def8b1050 100755 --- a/packages/anastasis-webui/build.mjs +++ b/packages/anastasis-webui/build.mjs @@ -104,8 +104,31 @@ function copyFilesPlugin(options) { }; } +function getFilesInDirectory(startPath, regex) { + if (!fs.existsSync(startPath)) { + return; + } + const files = fs.readdirSync(startPath); + const result = files.flatMap(file => { + const filename = path.join(startPath, file); + + const stat = fs.lstatSync(filename); + if (stat.isDirectory()) { + return getFilesInDirectory(filename, regex); + } + else if (regex.test(filename)) { + return filename + } + }).filter(x => !!x) + + return result +} + +const allTestFiles = getFilesInDirectory(path.join(BASE, 'src'), /test.tsx?$/) +const entryPoints = ["src/index.ts", "src/stories.tsx", ...allTestFiles]; + export const buildConfig = { - entryPoints: ['src/index.ts', 'src/stories.tsx'], + entryPoints: [...entryPoints], bundle: true, outdir: 'dist', minify: false, |