Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/importers/sassTildeImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ export const sassTildeImporter: sass.FileImporter<'sync'> = {
// Support sass partials by including paths where the file is prefixed by an underscore.
const basename = path.basename(nodeModSubpath);
if (!basename.startsWith('_')) {
const partials = subpathsWithExts.map((file) =>
file.replace(basename, `_${basename}`),
);
const partials = subpathsWithExts.map((file) => {
const parts = path.parse(file);
const replacement = '_'.concat(parts.name);
parts.base = parts.base.replace(parts.name, replacement);
parts.name = replacement;
return path.format(parts);
});
subpathsWithExts.push(...partials);
}

Expand Down