From c216fffe120e06122664e0ac90deeae54c93faf9 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Wed, 29 Jul 2026 21:29:52 +0200 Subject: [PATCH] feat(build): implement implicit artifact copy source path --- build/utils/artifact.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build/utils/artifact.js b/build/utils/artifact.js index d3399ce..8187de3 100644 --- a/build/utils/artifact.js +++ b/build/utils/artifact.js @@ -30,8 +30,10 @@ const validateArtifact = function validateArtifact (artifact) { ) ); } else if (artifact.type === 'copy') { - if (!artifact.options) return false; - return typeof artifact.options.source === 'string'; + if (!artifact.options) return true; + else if (Object.hasOwn(artifact.options), 'source') { + return typeof artifact.options.source === 'string'; + } else return true; } }; @@ -55,7 +57,12 @@ export const processArtifact = async function processArtifact (artifact, { srcBa ); console.log(`Wrote to ${distPath}`); } else if (artifact.type === 'copy') { - const srcPath = join(srcBase, artifact.options.source); + const srcPath = join( + srcBase, + artifact.options + ? (artifact.options.source ?? artifact.path) + : artifact.path + ); await cp( srcPath, distPath,