leafo / scssphp

SCSS compiler written in PHP
MIT License
1.34k stars 214 forks source link

Skip specific imports #621

Closed RdeWilde closed 5 years ago

RdeWilde commented 5 years ago

Is it possible to skip certain imports?

For example I have the bootstrap lib locally installed and imported to get auto-completion to work, but in production the actual file is served from CDN. Is there any way to exclude the complete bootstrap lib, but keep my custom code compiling?

cyberalien commented 5 years ago

I was looking for similar issue, found a solution.

Extend compiler class, override function findImport(). If parameter matches file you want to skip, return null (then you get to keep import statement in output) or replace with dummy file (then import will not be in output).