Skip to content

Commit

Permalink
Create style directory if does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rsefer committed Apr 25, 2024
1 parent a27e50b commit a92dcdb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ export const buildSassTheme = async () => {

export const buildSass = async (entry, name, entriesToLint) => {
let timerStart = Date.now();
let destinationLayers = name.split('/');
let destinationPrefix = project.path + '/dist/';
for (var i = 0; i < destinationLayers.length - 1; i++) {
destinationPrefix += destinationLayers[i] + '/';
if (!fs.existsSync(destinationPrefix)) {
fs.mkdirSync(destinationPrefix);
}
}
let outFile = project.path + '/dist/' + name + '.min.css';
if (name.startsWith('blocks/')) {
outFile = project.path + '/' + name + '.min.css';
Expand Down

0 comments on commit a92dcdb

Please sign in to comment.