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

Batch mode exclude files #51

Closed
XhmikosR opened this issue Feb 10, 2021 · 6 comments
Closed

Batch mode exclude files #51

XhmikosR opened this issue Feb 10, 2021 · 6 comments

Comments

@XhmikosR
Copy link
Contributor

@jakubpawlowicz I'm experimenting with the --batch option which seems exactly what we need on Bootstrap.

The problem I have is that I'm not sure how to exclude files. Currently we have all of our CSS files in one dir:

bootstrap-grid.css
bootstrap-grid.min.css
bootstrap-grid.rtl.css
bootstrap-grid.rtl.min.css
bootstrap-reboot.css
bootstrap-reboot.min.css
bootstrap-reboot.rtl.css
bootstrap-reboot.rtl.min.css
bootstrap-utilities.css
bootstrap-utilities.min.css
bootstrap-utilities.rtl.css
bootstrap-utilities.rtl.min.css
bootstrap.css
bootstrap.min.css
bootstrap.rtl.css
bootstrap.rtl.min.css

I tried excluding the files that end with *.min.css but it doesn't work:

cleancss -O1 --format breakWith=lf --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix ".min" "dist/css/*.css" "!dist/css/*.min.css"
WARNING: Invalid character(s) '/*.min.css);' at 1:21. Ignoring.
internal/fs/utils.js:307
    throw err;
    ^

Error: ENOENT: no such file or directory, open '!dist/css/*.min.min.css'

Am I maybe missing something?

Thanks!

@jakubpawlowicz
Copy link
Collaborator

Hey @XhmikosR - I thought it's possible but really haven't tested for it until you asked. Looks like a small change will be needed as glob expects excluding pattern to be passed via ignore option. Let me add it tomorrow.

@XhmikosR
Copy link
Contributor Author

Thanks @jakubpawlowicz. BTW the failure didn't result in an error code 1 so the build (wrongfully?) continues on linux. On my Windows VM, the build does fail with 1.

@XhmikosR
Copy link
Contributor Author

@jakubpawlowicz
Copy link
Collaborator

Since CLI returns just a warning then the build continues on Linux just fine. It's interesting the build does return error code 1 on Windows though.

@jakubpawlowicz
Copy link
Collaborator

Re fix to this issue - please see the commit above. Can you possibly test it locally?

@XhmikosR XhmikosR mentioned this issue Feb 11, 2021
@XhmikosR
Copy link
Contributor Author

@jakubpawlowicz confirmed it works now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants