node-sass-magic-importer
Version:
Custom node-sass importer for selector specific imports, node importing, module importing, globbing support and importing files only once
11 lines (8 loc) • 325 B
text/typescript
import { IPath } from '../interfaces/IPath';
import { ISassGlobPattern } from '../interfaces/ISassGlobPattern';
export function sassGlobPatternFactory(path: IPath): ISassGlobPattern {
return (base: string) => {
const { name, ext } = path.parse(base);
return ext ? base : `?(_)${name}@(.css|.sass|.scss)`;
};
}