Javascript build-web-agent.js fixes (#107)
* chore: update build script to use Node.js built-in modules and fix linting issues ## CHANGES - Replace CommonJS require with node: prefix - Remove unused _workspaceRoot variable declaration - Change template literal to regular string - Update .gitignore to exclude VSCode settings * feat: remove unused workspace root variable from build configuration
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -14,4 +14,7 @@ build/
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
.env
|
.env
|
||||||
|
|
||||||
|
# VSCode settings
|
||||||
|
.vscode/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
const fs = require("fs");
|
const fs = require("node:fs");
|
||||||
const path = require("path");
|
const path = require("node:path");
|
||||||
|
|
||||||
// --- Configuration ---
|
// --- Configuration ---
|
||||||
const configFilePath = "./build-web-agent.cfg.js"; // Path relative to this script (__dirname)
|
const configFilePath = "./build-web-agent.cfg.js"; // Path relative to this script (__dirname)
|
||||||
@@ -60,7 +60,6 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Determine and validate asset folder root and build directory
|
// 2. Determine and validate asset folder root and build directory
|
||||||
const workspaceRoot = path.resolve(__dirname, ".");
|
|
||||||
|
|
||||||
const assetFolderRootInput = config.asset_root;
|
const assetFolderRootInput = config.asset_root;
|
||||||
let assetFolderRoot;
|
let assetFolderRoot;
|
||||||
@@ -193,7 +192,7 @@ Discovering source directories in '${assetFolderRoot}' (excluding '${buildDirNam
|
|||||||
` Conflicting files: '${baseFilenamesSeen[baseName]}' and '${filenameWithExt}'.`
|
` Conflicting files: '${baseFilenamesSeen[baseName]}' and '${filenameWithExt}'.`
|
||||||
);
|
);
|
||||||
console.error(
|
console.error(
|
||||||
` Please ensure all files in a subdirectory have unique names after removing their last extensions.`
|
" Please ensure all files in a subdirectory have unique names after removing their last extensions."
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user