scss-bundle icon indicating copy to clipboard operation
scss-bundle copied to clipboard

feat: Fall back to `.css` files if no `.scss` file found

Open gbannerman opened this issue 3 years ago • 4 comments

In #48, it was noted that all import paths had the .scss extension added if not already present. A fix was merged which solved the situation of a .css extension being specified, but it did not solve the case where an import is for a .css file but does not specify the extension. This change solves that by falling back to looking for .css files if a .scss file cannot be found.

gbannerman avatar May 22 '22 15:05 gbannerman

We are bundling some SCSS which relies on libraries that use CSS files and don't include SCSS. This change would be very useful.

This feels like a sensible enough default, though it may be preferable to put this behavior behind a configuration option.

gbannerman avatar May 22 '22 15:05 gbannerman

@DovydasNavickas @MartynasZilinskas Is this project still maintained? Would be great to get this small change merged and released.

gbannerman avatar May 23 '22 18:05 gbannerman

Hi @gbannerman,

The project is not much maintained as it needs a bigger rewrite to support new SCSS features, but PRs like yours can be merged.

That said, I would rather you added the functionality behind a flag or we release it under a major version. This might break someone's project and as the library has a long history and I wouldn't want to break very old projects.

DovydasNavickas avatar May 24 '22 06:05 DovydasNavickas

I would rather you added the functionality behind a flag or we release it under a major version

Yes I agree that's a safer approach. I can update this PR to use a flag.

gbannerman avatar May 24 '22 08:05 gbannerman