Skip to content

Commit

Permalink
Remove LibSass deprecation warning for css files.
Browse files Browse the repository at this point in the history
Includes file contents instead of file path to avoid deprecation message.
See #181
  • Loading branch information
nlemoine committed Dec 3, 2018
1 parent 2eb9a1d commit 47eb773
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/node-sass-package-importer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as fs from 'fs';
import {
buildIncludePaths,
resolvePackageUrl,
Expand Down Expand Up @@ -37,6 +38,14 @@ export = function packageImporter(userOptions?: IPackageImporterOptions) {
options.packageKeys,
);

return file ? { file: file.replace(/\.css$/, ``) } : null;
if (!file) {
return null;
}

if (/\.css$/.test(file)) {
return { contents: fs.readFileSync(file, 'utf-8') };
}

return { file: file.replace(/\.css$/, ``) };
};
};

0 comments on commit 47eb773

Please sign in to comment.