-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
33 lines (27 loc) · 821 Bytes
/
Copy pathbuild.js
File metadata and controls
33 lines (27 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const fs = require('fs');
const path = require('path');
// Target directory
const distDir = path.join(__dirname, 'dist');
// Create directory (if it exists, it doesn't clean/delete, just creates)
if (!fs.existsSync(distDir)) {
fs.mkdirSync(distDir);
console.log('[Build] dist directory created.');
}
// Files to copy
const filesToCopy = [
'index.html',
'style.css',
'app.js'
];
// Copy files
filesToCopy.forEach(file => {
const src = path.join(__dirname, file);
const dest = path.join(distDir, file);
if (fs.existsSync(src)) {
fs.copyFileSync(src, dest);
console.log(`[Build] ${file} -> dist/${file} copied.`);
} else {
console.warn(`[Build] Warning: ${file} not found!`);
}
});
console.log('[Build] Completed! Project is ready for Render.com.');