Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Output to memory #63

Merged
merged 2 commits into from
Feb 9, 2015
Merged

Output to memory #63

merged 2 commits into from
Feb 9, 2015

Conversation

crisptrutski
Copy link
Contributor

@guybedford let me know if you're happy with this approach, most notably the API (return file-contents string within promise).

Perhaps a stream is more suitable, and I'm not sure what was meant by "memory FS". Looked at things like https://github.com/tschaub/mock-fs, but that sort of evil seems doesn't seem to belong outside of testing, and not sure the value it would add in the scenario vs return an inlined-file or a dictionary of the separate files.

Need to hook up Uglify for in-memory usage, and refactor my goop (been a while, JavaScript)

Closes #54

@crisptrutski crisptrutski force-pushed the memory-output branch 3 times, most recently from 0c13068 to ed5b349 Compare February 9, 2015 10:58
content += '\n//# sourceMappingURL=data:application/json;base64,' +
new Buffer(output.sourceMap.toString()).toString('base64');
}
return wrapPromise(content);
Copy link
Member

Choose a reason for hiding this comment

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

You can just do Promise.resolve(content) here.

@guybedford
Copy link
Member

👍 perhaps just output.source and output.sourceMap though?

@crisptrutski
Copy link
Contributor Author

Yeah, makes the tests for #58 easier too..

Was originally intending to send to standard output for CLI usage, hence the inline-ing, but would need to disable all the other logging though, so perhaps reserve a flag for that.

Not sure if people would actually want to use it this way though.

@guybedford
Copy link
Member

Ok great. Yeah CLI streaming can be implemented if and when there is demand, happy to leave it out for now.

@crisptrutski crisptrutski changed the title WIP Output to memory Output to memory Feb 9, 2015
@crisptrutski
Copy link
Contributor Author

Points addressed, let me know if I should squash

@guybedford
Copy link
Member

Awesome, thanks. Are the source maps looking like they're working?

@crisptrutski
Copy link
Contributor Author

Looking good for non-chained. Will squash get this merged, look at the chaining in #64

crisptrutski added a commit that referenced this pull request Feb 9, 2015
@crisptrutski crisptrutski merged commit c2203de into master Feb 9, 2015
@crisptrutski crisptrutski deleted the memory-output branch February 12, 2015 10:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output to memory
2 participants