Closed rmobis closed 5 years ago
Ok, so, apparently fs-extra
doesn't support Node.js versions prior to 5.0. That means this PR becomes a breaking change, so I'm not 100% sure if you'll want to merge it. It's worth noting though that Node 4.0 and 5.0 have long been discontinued and 6.0 (Boron) will reach end of life in April 2019, just a few months away.
Edit: Node 4.0 probably works with --harmony
flag.
What about altering this to use mkdirp
instead? I believe that supports older versions of node, and running it on an existing directory is a noop.
That sounds like a better idea, ye. Closing this in favor of #53.
By default,
writeFile
will not create the output directory if it does not exist and, as such, will cause an error to be thrown when it doesn't. This is a nuisance because dist folder are usually not commited to the repository so you either have to create the folder structure and commit it with a.gitignore
file, or run a script to create these folders pre-build.Using
fs-extra
'soutputFile
method instead offs-promise
'swriteFile
does create the folder though, avoiding all this nuisance. This PR does just that. Please note thatfs-extra
is a drop-in replacement forfs
/fs-promise
- which, by the way, has been deprecated -, so I don't believe there'll be any problems.