Commit dc19cd52 by Nowell Strite

Custom importers cause out of order chained imports.

parent 03aa20e7
...@@ -186,6 +186,29 @@ describe('api', function() { ...@@ -186,6 +186,29 @@ describe('api', function() {
describe('.render(importer)', function() { describe('.render(importer)', function() {
var src = read(fixture('include-files/index.scss'), 'utf8'); var src = read(fixture('include-files/index.scss'), 'utf8');
it('should respect the order of chained imports when using custom importers and one file is custom imported and the other is not.', function(done) {
sass.render({
file: fixture('include-files/chained-imports-with-custom-importer.scss'),
importer: function(url, prev, done) {
if (url !== 'file-processed-by-loader') {
return sass.NULL;
}
done({
file: fixture('include-files/file-processed-by-loader.scss')
});
}
}, function(err, data) {
assert.equal(err, null);
assert.equal(
data.css.toString().trim(),
'body {\n color: "red"; }'
);
done();
});
});
it('should still call the next importer with the resolved prev path when the previous importer returned both a file and contents property - issue #1219', function(done) { it('should still call the next importer with the resolved prev path when the previous importer returned both a file and contents property - issue #1219', function(done) {
sass.render({ sass.render({
data: '@import "a";', data: '@import "a";',
......
@import "file-not-processed-by-loader", "file-processed-by-loader";
$variable-defined-by-file-not-processed-by-loader: 'red';
body {
color: $variable-defined-by-file-not-processed-by-loader;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment