Skip to content

Commit

Permalink
💚 Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaoz-Topsy committed Jul 24, 2024
1 parent 20c9bf8 commit f6dea9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/misc/sass.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import fs from 'fs/promises';
import sass from 'sass';

import { createFoldersOfDestFilePath } from 'helpers/fileHelper';

export const generateMainCss = () => {
const cssContent = sass.compile('src/scss/main.scss');
fs.writeFile('public/assets/css/main.css', cssContent.css);
const destFile = 'public/assets/css/main.css';
createFoldersOfDestFilePath(destFile);
fs.writeFile(destFile, cssContent.css);
if (cssContent.sourceMap != null) {
fs.writeFile('public/assets/css/main.css.map', JSON.stringify(cssContent.sourceMap));
fs.writeFile(destFile.replace('.css', '.css.map'), JSON.stringify(cssContent.sourceMap));
}
};

0 comments on commit f6dea9d

Please sign in to comment.