-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
32 lines (26 loc) · 991 Bytes
/
build.js
File metadata and controls
32 lines (26 loc) · 991 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
const fs = require('fs-extra');
const path = require('path');
const { execSync } = require('child_process');
// Define paths
const rootDir = __dirname;
const distDir = path.join(rootDir, 'dist');
// Main build function
async function build() {
console.log('Building Sentinel Security Assistant extension...');
try {
// Clean up existing dist folder if it exists
console.log('Cleaning dist folder...');
await fs.emptyDir(distDir);
// Run webpack build
console.log('Running webpack build...');
execSync('npm run build', { stdio: 'inherit' });
console.log('Build complete! Extension files are in the dist folder.');
console.log('To load the extension in Chrome, go to chrome://extensions/, enable Developer mode,');
console.log('and click "Load unpacked" to select your dist folder.');
} catch (error) {
console.error('Error during build process:', error);
process.exit(1);
}
}
// Run the build
build();