question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

transformedAssetTypes is ignored

See original GitHub issue

I am using Pattern Lab Node v5.15.0 on Linux, with Node v16, using a Twig Edition.

Expected Behavior

When using a preprocessor like PostCSS to process CSS files, you want to deactivate the copy task for CSS. To do this, based on the manual, I would set following property in my pattern lab configuration:

{
  "transformedAssetTypes": ["css", "js"]
}

Now building pattern lab, the public css folder set in paths.public.css should not contain any CSS files.

Actual Behavior

transformedAssetTypes seems to ignore the type “css”. It copies all the CSS files as configured in paths.source.css to paths.public.css.

As the preprocessor might be faster in compliling, Pattern Lab is also gonna overwrite any previously compiled CSS.

Actually, after testing further, it seems that setting is not applied any file type. I tested it with .scss as file type by setting transformedAssetTypes to ["scss"] and file is still being copied despite the setting.

Steps to Reproduce
  1. Configure paths for CSS in paths.source.css and paths.public.css.
  2. Add a CSS file to the source path
  3. Set the transformedAssetTypes to ["css"].
  4. Run patternlab build --config ./patternlab-config.json

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JosefBredereckcommented, Jul 22, 2021

Somewhere in the copier.js at transform_paths, we could add functionality to ignore specific paths, or in copyFile.js, we could add the option to ignore with transformedAssetTypes. I currently do not know If recursive-copy supports ignoring files or if we have to build something new here.

1reaction
JosefBredereckcommented, Jul 22, 2021

Phew, I don’t know if this is the correct option. We have some old documentation here in the pattern lab wiki which does not match the patternlab.io website.

In my opinion, the functionality should do the same in watch and build mode, so that you don’t have different results.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editing the Configuration Options - Pattern Lab
Live-Reload: Regular expression for ignoring specific file types from being watched for changes in the filesystem. file, "index.html", When set, serve this file ......
Read more >
patternlab-node
transformedAssetTypes is ignored. StfBauer. StfBauer CLOSED · Updated 1 year ago · Problem after upgrade to 5.15. mfranzke. mfranzke OPEN.
Read more >
@pattern-lab/starterkit-twig-demo [javascript]: Datasheet
fix: transformed asset types is ignored (#1426) * fix: transformedAssetTypes is ignored #1339 * chore: we could still use const here * chore:...
Read more >
Bug: `console` + `commands` 会出现“文件不存在”问题
YOU MAY BE INTERESTED ; transformedAssetTypes is ignored, 6, 2021-07-19 ; Not working on Apple Silicon, 14, 2021-01-27 ; Custom error message ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found