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

Option to ignore css Files #24

Closed
DG606 opened this issue Feb 17, 2023 · 5 comments
Closed

Option to ignore css Files #24

DG606 opened this issue Feb 17, 2023 · 5 comments
Labels
wontfix This will not be worked on

Comments

@DG606
Copy link

DG606 commented Feb 17, 2023

Hi,

i have problems that sass won't compile my css Files (Error: Interpolation isn't allowed in plain CSS) but it is not needed to compile css!
Is it possible to add an extra option to ignore css Files? Or maybe support of * in inputFolder like src/main/webapp/resources/**/*.scss?

Thanks
Daniel

@cleydyr
Copy link
Owner

cleydyr commented Feb 17, 2023

Hey, @DG606 .

Do you have a minimal example that I can use to reproduce that behavior?

Also, can you compile the files normally using the Dart Sass executable? If yes, then can you share the command and the file that is being compiled?

@cleydyr cleydyr added the triage label Feb 17, 2023
@DG606
Copy link
Author

DG606 commented Feb 17, 2023

Hi,
if i use the dartsass executeable with the command: sass --update src/main/webapp/resources:src/main/webapp/resources --no-source-map it compiles all my *.scss file in resources and subfolders. All css File in there will be ignored. So no error takes place. (Version 1.58.1) But the version in plugin is not the problem, i have change it to 1.58.1 lokal as a test.

The maven plugin includes all css Files for compiling. So i get an error. As an workaround I rename my *.css File to *.Css . So the plugin ignores it ;-) but this feels like a bad solution.

cssfile content (the '#{resource' will be replaces later at deployment of jsf application which i can't change:
@font-face {
src: url("#{resource['layout:icons/icons.eot']}");
src: url("#{resource['layout:icons/icons.eot']}#iefix") format('embedded-opentype'),
url("#{resource['layout:icons/icons.ttf']}") format('truetype'),
url("#{resource['layout:icons/icons.woff']}") format('woff'),
url("#{resource['layout:icons/icons.svg']}#icons") format('svg');
font-weight: normal;
font-style: normal;
}

@cleydyr
Copy link
Owner

cleydyr commented Feb 17, 2023

Hey, @DG606. Thanks for sharing a sample CSS file.

I see that that's the same behavior that you get if you use Dart Sass CLI in the many-to-one mode and the input folder and the output folder are different. So the plugin is behaving the same way the CLI does. Try to compile files in folder A to a different folder B and you'll get the same error.

As a workaround, can you try setting the inputFolder and outputFolder parameters for the plugin in your pom.xml and try to execute the plugin goal again?

@DG606
Copy link
Author

DG606 commented Feb 17, 2023

Hi,
yes it works if I use same input and output folder. Very strange! So I can use it but than I have to exclude generated css-files from my cvs. :-(
Thanks for your help.

@DG606 DG606 closed this as completed Feb 17, 2023
@cleydyr
Copy link
Owner

cleydyr commented Feb 17, 2023

See sass/dart-sass#862

You're leveraging that feature of the CLI: if there's a .css file inside a directory and the destination is the same folder, then it won't be compiled, so that's why you see no error. You have to assume that .css files will be compiled if the source and destinations are different.

That being said, this is not something we'll fix so that we don't override the CLI behavior. Just set inputFolder and outputFolder to the same path.

@cleydyr cleydyr added wontfix This will not be worked on and removed triage labels Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants