Skip to content

Commit

Permalink
fix: transformedAssetTypes is ignored pattern-lab#1339
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranzke committed Feb 5, 2022
1 parent 4335660 commit c1cb97e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/core/src/lib/copier.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,22 @@ const copier = () => {
//find out where we are
const basePath = path.resolve(process.cwd());

const copyOptions = {
let copyOptions = {
overwrite: true,
emitter: patternlab.events,
debug: patternlab.config.logLevel === 'debug',
};

// Adding assets to filter for in case of transformedAssetTypes defined; adapted regex from packages/core/src/lib/watchAssets.js#L45
if (patternlab.config.transformedAssetTypes) {
copyOptions.filter = new RegExp(
`^.*\\.(?!${patternlab.config.transformedAssetTypes.join(
'$|'
)}$)[^.]+$`,
'i'
);
}

//loop through each directory asset object (source / public pairing)

const copyPromises = [];
Expand Down

0 comments on commit c1cb97e

Please sign in to comment.