Skip to content

Commit 4dd31b8

Browse files
committed
Bugfix: Wait when writing a file
1 parent 980f2b4 commit 4dd31b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function makeBundler(config, assetManager, { browsers, compact, sourcemaps } = {
3535
// If this is the first run or the changed file is one of the
3636
// previously included ones, run the compiler
3737
if(previouslyIncluded(filepaths, previouslyIncludedFiles)) {
38-
postCSS().
38+
return postCSS().
3939
then(result => {
4040
previouslyIncludedFiles = result.stats.includedFiles.
4141
map(filepath => path.normalize(filepath));
@@ -44,14 +44,14 @@ function makeBundler(config, assetManager, { browsers, compact, sourcemaps } = {
4444
if(fingerprint !== undefined) {
4545
options.fingerprint = fingerprint;
4646
}
47-
assetManager.writeFile(target, result.css, options);
47+
return assetManager.writeFile(target, result.css, options);
4848
}).
4949
catch(error => {
5050
let options = { error };
5151
if(fingerprint !== undefined) {
5252
options.fingerprint = fingerprint;
5353
}
54-
assetManager.writeFile(target, errorOutput(error.message,
54+
return assetManager.writeFile(target, errorOutput(error.message,
5555
assetManager.referenceDir),
5656
options);
5757
});

0 commit comments

Comments
 (0)