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.

postcss-cli do not copy folder structure from input files when pattern is used

See original GitHub issue

I am trying to compile multiple *.pcss files and have the *.css output sit in the same directory. For example, I have the following structure:

src
-- test1
---- 1.pcss
-- test2
---- 2.pcss
-- test3
---- 3.pcss

When running:

postcss --use precss src/**/*.pcss --dir out/

I expect:

src
-- test1
---- 1.pcss
-- test2
---- 2.pcss
-- test3
---- 3.pcss
out
-- test1
---- 1.css
-- test2
---- 2.css
-- test3
---- 3.css

But what I got is:

src
-- test1
---- 1.pcss
-- test2
---- 2.pcss
-- test3
---- 3.pcss
out
-- 1.pcss
-- 2.pcss
-- 3.pcss

So there are 2 issues here:

  1. The output doesn’t have the same folder structure as the input when used with pattern.
  2. I don’t seem to be able to specify the output file extension when using --dir.

Any suggestion please?

By the way, it would be great if such options are also available in a config file as that’s where I actually configure the options 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
michael-ciniawskycommented, Jan 30, 2017

@ai I understand, will try to see what options we have for renaming extname

postcss src/*.pcss -o dest --ext '.css'

0reactions
aesopturtlecommented, Jan 30, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

postcss-cli - npm
Start using postcss-cli in your project by running `npm i postcss-cli` ... input & output If no input files are passed, it reads...
Read more >
Postcss-cli NPM - npm.io
If you pass an input directory, it will process all files in the directory and any subdirectories, respecting the glob pattern. ℹ️ More...
Read more >
postcss-cli - UNPKG
postcss -cli/CHANGELOG.md ; 162, - Can't set input files in config file; pass input files on the command line instead. ; 163, -...
Read more >
PostCSS Crash Course - YouTube
PostCSS is a Javascript tool used to transform your project's CSS. In this crash course, I'll talk you through the basics, compare PostCSS...
Read more >
postcss multiple files | The AI Search Engine You Control
I believe PostCSS starts looking for the input file before it is generated. ... do not copy folder structure from input files when...
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