-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
30 lines (25 loc) · 1.04 KB
/
build.js
File metadata and controls
30 lines (25 loc) · 1.04 KB
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
const fs = require('fs-extra');
const path = require('path');
// Define paths
const staticSrcDir = path.join(__dirname, 'src', 'static');
const staticDestDir = path.join(__dirname, 'dist', 'static');
// Ensure the destination directory exists
fs.ensureDirSync(staticDestDir);
// Copy static files if the source directory exists
if (fs.existsSync(staticSrcDir)) {
console.log('Copying static files to dist folder...');
fs.copySync(staticSrcDir, staticDestDir);
console.log('Static files copied successfully!');
} else {
console.log('Static source directory not found. Skipping copy.');
}
// Copy static directory from project root if it exists
const rootStaticDir = path.join(__dirname, 'static');
if (fs.existsSync(rootStaticDir)) {
console.log('Copying root static files to dist folder...');
fs.copySync(rootStaticDir, path.join(__dirname, 'dist', 'static'));
console.log('Root static files copied successfully!');
} else {
console.log('Root static directory not found. Skipping copy.');
}
console.log('Build post-processing completed!');