diff --git a/packages/kit/src/core/sync/copy_assets.js b/packages/kit/src/core/sync/copy_assets.js index d784713ad4fe..10401aa25b54 100644 --- a/packages/kit/src/core/sync/copy_assets.js +++ b/packages/kit/src/core/sync/copy_assets.js @@ -8,19 +8,18 @@ const __dirname = path.dirname(__filename); /** @param {string} dest */ export function copy_assets(dest) { - if (process.env.BUNDLED) { - let prefix = '..'; - do { - // we jump through these hoops so that this function - // works whether or not it's been bundled - const resolved = path.resolve(__dirname, `${prefix}/assets`); + if (!process.env.BUNDLED) return; + let prefix = '..'; + do { + // we jump through these hoops so that this function + // works whether or not it's been bundled + const resolved = path.resolve(__dirname, `${prefix}/assets`); - if (fs.existsSync(resolved)) { - copy(resolved, dest); - return; - } + if (fs.existsSync(resolved)) { + copy(resolved, dest); + return; + } - prefix = `../${prefix}`; - } while (true); // eslint-disable-line - } + prefix = `../${prefix}`; + } while (true); // eslint-disable-line }