Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Importer sourceMap #1584

Open
flops opened this issue Jun 8, 2016 · 5 comments
Open

Importer sourceMap #1584

flops opened this issue Jun 8, 2016 · 5 comments

Comments

@flops
Copy link

flops commented Jun 8, 2016

It could be a crazy question. But didn`t even found a mention about it. For example json or yaml importers, that mapping data structure to sass variabled in global scope, would be wonderful to pass sourceMap on this step. Or even more sensetive things like import non-sass processed css files from other modules.

Something like:

done({
  contents: 'file_transformed_to_sass',
  sourceMap: 'sourceMap_of_file_to_compiled_scss_file'
});
@xzyfer
Copy link
Contributor

xzyfer commented Jun 14, 2016

I don't understand the problem you're trying to solve. Could you please be more specific?

@flops
Copy link
Author

flops commented Jun 14, 2016

Sorry for so clumsy start.
The question is about custom importers. For example, i`ve got json importer function, that takes json, and generating scss documents like:

('vars.json') JSON:

{
  "foo": "100px",
  "bar": "200px"
}

(converted 'vars.json') to Scss:

$foo: 100px;
$bar: 200px;
// sourceMap = ****

So when i will give the content to importer with scss content inside, there is wont be even a mention about the json file in generated css file. So i`ve been thinking about it, and that would be great to pass the sourceMap data to importer with content. And when you will open a debug tools youl see your "style.scss" and "vars.json" with correct mapping to them.

@nschonni
Copy link
Contributor

This sounds like a feature request that should be made in the libsass repo

@marcofugaro
Copy link

Another example would be this package, basically it makes sass import globs like @import 'components/*.scss';, but the problem is that in the browser the name of the file is *.scss instead of the actual file name.

@saper
Copy link
Member

saper commented Oct 18, 2019

sass/libsass@96ff08c#diff-dbf9ef646767bb67f153df33f848eda8R14

explains that libsass does not have this implemented yet

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants