feat: AI Pricing Transparency Scanner Chrome Extension v1.0.0
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// scripts/build.mjs — copies src to dist (no transpilation needed, plain JS)
|
||||
import { readFileSync, writeFileSync, mkdirSync, readdirSync, statSync, copyFileSync, existsSync } from 'fs';
|
||||
import { join, dirname, relative } from 'path';
|
||||
|
||||
const root = dirname(new URL(import.meta.url).pathname);
|
||||
const projectRoot = join(root, '..');
|
||||
const srcDir = join(projectRoot, 'src');
|
||||
const distDir = join(projectRoot, 'dist');
|
||||
|
||||
function copyDir(src, dest) {
|
||||
mkdirSync(dest, { recursive: true });
|
||||
const entries = readdirSync(src);
|
||||
for (const entry of entries) {
|
||||
const srcPath = join(src, entry);
|
||||
const destPath = join(dest, entry);
|
||||
const stat = statSync(srcPath);
|
||||
if (stat.isDirectory()) {
|
||||
copyDir(srcPath, destPath);
|
||||
} else {
|
||||
copyFileSync(srcPath, destPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clean dist
|
||||
if (existsSync(distDir)) {
|
||||
// Just overwrite files
|
||||
}
|
||||
|
||||
copyDir(srcDir, distDir);
|
||||
console.log('Build complete: src → dist');
|
||||
Reference in New Issue
Block a user