mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-29 20:29:01 +01:00
parent
b7b4580bb4
commit
e63b8e1b40
1
AUTHORS
1
AUTHORS
@ -4,3 +4,4 @@
|
||||
# Name/Organization <email address>
|
||||
|
||||
Google Inc.
|
||||
Marks and Spencer Plc. John Harvey John.Harvey@marks-and-spencer.com
|
||||
|
@ -1,3 +1,8 @@
|
||||
## 1.0.0-beta.6
|
||||
|
||||
* Add support for importing an `_index.scss` or `_index.sass` file when
|
||||
importing a directory.
|
||||
|
||||
## 1.0.0-beta.5.3
|
||||
|
||||
* Support hard tabs in the indented syntax.
|
||||
|
@ -7,13 +7,14 @@ import '../util/path.dart';
|
||||
|
||||
/// Resolves an imported path using the same logic as the filesystem importer.
|
||||
///
|
||||
/// This tries to fill in extensions and partial prefixes. If no file can be
|
||||
/// This tries to fill in extensions and partial prefixes and check if a directory default. If no file can be
|
||||
/// found, it returns `null`.
|
||||
String resolveImportPath(String path) {
|
||||
var extension = p.extension(path);
|
||||
return extension == '.sass' || extension == '.scss'
|
||||
? _tryPath(path)
|
||||
: _tryPathWithExtensions(path);
|
||||
if (extension == '.sass' || extension == '.scss') return _tryPath(path);
|
||||
|
||||
var file = _tryPathWithExtensions(path);
|
||||
return file != null ? file : _tryPathAsDirectory(path);
|
||||
}
|
||||
|
||||
/// Like [_tryPath], but checks both `.sass` and `.scss` extensions.
|
||||
@ -30,3 +31,10 @@ String _tryPath(String path) {
|
||||
if (fileExists(path)) return path;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Returns the resolved index file for [path] if [path] is a directory and the
|
||||
/// index file exists.
|
||||
///
|
||||
/// Otherwise, returns `null`.
|
||||
String _tryPathAsDirectory(String path) =>
|
||||
dirExists(path) ? _tryPathWithExtensions(p.join(path, 'index')) : null;
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: sass
|
||||
version: 1.0.0-beta.5.3
|
||||
version: 1.0.0-dev
|
||||
description: A Sass implementation in Dart.
|
||||
author: Dart Team <misc@dartlang.org>
|
||||
homepage: https://github.com/sass/dart-sass
|
||||
|
Loading…
Reference in New Issue
Block a user