Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Properly support source maps with 2+ sources #1147

Merged
merged 1 commit into from Feb 4, 2016
Merged

Properly support source maps with 2+ sources #1147

merged 1 commit into from Feb 4, 2016

Conversation

goshacmd
Copy link
Contributor

@goshacmd goshacmd commented Feb 3, 2016

Which is needed to properly handle source maps for pre-processed stylesheets

if (sourceMap && sourceMap.sources) {
sourceMap.sources.forEach(path => {
const file = fileList.find(path);
const content = file && file.source || fs.readFileSync(path).toString();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes a file won't be on the file list (e.g. if it's _something.sass and _* files are ignored) so it's probably ok to read these synchronously

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We read those files with fcache already.

return node;

// the supplied source map might contain more than one source file
const addSource = path => readFile(path).then(content => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use fcache for reads

paulmillr added a commit that referenced this pull request Feb 4, 2016
Properly support source maps with 2+ sources
@paulmillr paulmillr merged commit 1536dec into brunch:master Feb 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants