Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: transformed asset types is ignored #1426

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/core/src/lib/copier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
`.*(?<![.](${patternlab.config.transformedAssetTypes.join('|')}))$`,
'i'
);
}

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

const copyPromises = [];
Expand Down Expand Up @@ -92,7 +100,7 @@ const copier = () => {
copyPromises.push(
_.map(patternlab.uikits, (uikit) => {
copyFile(
`${assetDirectories.source.root}/favicon.ico`,
`${assetDirectories.source.root}favicon.ico`,
path.join(
basePath,
uikit.outputDir,
Expand Down