From 8cbe189d45afaa753ce6de41bdd9de1596e074f3 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:28:02 +0100 Subject: [PATCH] fix: transformed asset types is ignored (#1426) * fix: transformedAssetTypes is ignored #1339 * chore: we could still use const here * chore: reduced unnecessary slash in the URL * refactor: simplified regex * refactor: simplified regex * refactor: corrected the regex as it was as well targeting .scss in configuring 'css' before --- packages/core/src/lib/copier.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/core/src/lib/copier.js b/packages/core/src/lib/copier.js index ef7990ec5..ba1c22788 100644 --- a/packages/core/src/lib/copier.js +++ b/packages/core/src/lib/copier.js @@ -55,6 +55,14 @@ const copier = () => { debug: patternlab.config.logLevel === 'debug', }; + // Adding assets to filter for in case of transformedAssetTypes defined; adapted regex from https://stackoverflow.com/a/6745455 + if (patternlab.config.transformedAssetTypes) { + copyOptions.filter = new RegExp( + `.*(? { copyPromises.push( _.map(patternlab.uikits, (uikit) => { copyFile( - `${assetDirectories.source.root}/favicon.ico`, + `${assetDirectories.source.root}favicon.ico`, path.join( basePath, uikit.outputDir,