-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calling .toString() is a fairly expensive operation, which allocates a new string, and copies all of the contents of the file Buffer into that string. This is fairly fast for small files or small sites, but quickly starts to take seconds of the total build time on medium sized sites (in my case, roughly 2 seconds of the overall build was this call to toString()!) This change makes it so we only call toString() if we actually want the result - i.e. if it as a sass file. Thus, we don't call it on markdown files, image files, video files, etc.
- Loading branch information
Showing
1 changed file
with
45 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters