-
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) · 855 Bytes
/
Copy pathbuild.js
File metadata and controls
30 lines (25 loc) · 855 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
import fs from 'fs';
// Copies static files to the dist directory
// clean up the dist directory if it exists
if (fs.existsSync('./dist')) {
fs.rmSync('./dist', { recursive: true });
}
fs.mkdirSync('./dist');
fs.mkdirSync('./dist/icons');
// Copy static files
const staticFiles = [
{ src: './manifest.json', dest: './dist/manifest.json' },
{ src: './icons/icon-16.png', dest: './dist/icons/icon-16.png' },
{ src: './icons/icon-48.png', dest: './dist/icons/icon-48.png' },
{ src: './icons/icon-128.png', dest: './dist/icons/icon-128.png' },
];
// Copy all files
staticFiles.forEach((file) => {
try {
fs.copyFileSync(file.src, file.dest);
console.log(`📁 Copied ${file.src} to ${file.dest}`);
} catch (err) {
console.error(`❌ Error copying ${file.src}:`, err);
}
});
console.log('✨ Static files copied successfully');