Skip to content

Commit bb2446e

Browse files
committed
genreate styles, scripts dir if not exists
1 parent f0cf6bd commit bb2446e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

merge-assets.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ const deployDir = path.resolve('./_deploy/assets');
66
const cssDir = path.join(deployDir, 'styles');
77
const jsDir = path.join(deployDir, 'scripts');
88

9+
// --- Ensure directories exist ---
10+
[deployDir, cssDir, jsDir].forEach((dir) => {
11+
if (!fs.existsSync(dir)) {
12+
fs.mkdirSync(dir, { recursive: true });
13+
}
14+
});
15+
916
const mergedCssFile = path.relative(process.cwd(), path.join(cssDir, 'bundle.css'));
1017
const mergedJsFile = path.relative(process.cwd(), path.join(jsDir, 'bundle.js'));
1118

0 commit comments

Comments
 (0)