Create public/css if it doesn't exist in process-styles.js

This commit is contained in:
Robbie Antenesse 2019-09-06 16:13:11 -06:00
parent 9800e5de70
commit e4eb9a846c
1 changed files with 6 additions and 0 deletions

View File

@ -21,6 +21,12 @@ sass.render({ file: 'index.scss' }, function (sassErr, css) {
console.warn(warn.toString()); console.warn(warn.toString());
}); });
if (!fs.existsSync('public')) {
fs.mkdirSync('public');
}
if (!fs.existsSync('public/css')) {
fs.mkdirSync('public/css');
}
fs.writeFile('public/css/index.css', result.css, (fileErr) => { fs.writeFile('public/css/index.css', result.css, (fileErr) => {
if (fileErr) { if (fileErr) {
throw fileErr; throw fileErr;