Allow .styl files in imports/ directories to be imported.

Analogous to cd8bc10b1d, which implemented
the same change in logic for .less files.
This commit is contained in:
Ben Newman
2016-05-06 13:02:21 -04:00
parent b5acef6def
commit a499c4abc3
2 changed files with 6 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: 'Expressive, dynamic, robust CSS',
version: "2.511.5"
version: "2.512.0"
});
Package.registerBuildPlugin({

View File

@@ -27,10 +27,10 @@ class StylusCompiler extends MultiFileCachingCompiler {
this.sourceMapSize(compileResult.sourceMap);
}
// The heuristic is that a file is an import (ie, is not itself processed as a
// root) if it is in a subdirectory named 'imports' or if it matches
// *.import.styl. This can be overridden in either direction via an explicit
// `isImport` file option in api.addFiles.
// The heuristic is that a file is an import (ie, is not itself
// processed as a root) if it matches *.import.styl. This can be
// overridden in either direction via an explicit `isImport` file option
// in api.addFiles.
isRoot(inputFile) {
const fileOptions = inputFile.getFileOptions();
if (fileOptions.hasOwnProperty('isImport')) {
@@ -38,8 +38,7 @@ class StylusCompiler extends MultiFileCachingCompiler {
}
const pathInPackage = inputFile.getPathInPackage();
return !(/\.import\.styl$/.test(pathInPackage) ||
/(?:^|\/)imports\//.test(pathInPackage));
return ! /\.import\.styl$/.test(pathInPackage);
}
compileOneFile(inputFile, allFiles) {