1
0
Fork 0
forked from svrjs/svrjs

build: move utils/ directory to src/extraScripts/

This commit is contained in:
Dorian Niemiec 2024-09-20 06:27:28 +02:00
parent efdf6f1551
commit 147c7c5d03
6 changed files with 5 additions and 5 deletions

View file

@ -187,19 +187,19 @@ esbuild
], ],
}) })
.then(() => { .then(() => {
const utilFilesAndDirectories = fs.existsSync(__dirname + "/utils") const utilFilesAndDirectories = fs.existsSync(__dirname + "/src/extraScripts")
? fs.readdirSync(__dirname + "/utils") ? fs.readdirSync(__dirname + "/src/extraScripts")
: []; : [];
const utilFiles = []; const utilFiles = [];
utilFilesAndDirectories.forEach((entry) => { utilFilesAndDirectories.forEach((entry) => {
if (fs.statSync(__dirname + "/utils/" + entry).isFile()) if (fs.statSync(__dirname + "/src/extraScripts/" + entry).isFile())
utilFiles.push(entry); utilFiles.push(entry);
}); });
// Transpile utilities using esbuild // Transpile utilities using esbuild
esbuild esbuild
.build({ .build({
entryPoints: utilFiles.map((filename) => "utils/" + filename), entryPoints: utilFiles.map((filename) => "src/extraScripts/" + filename),
bundle: true, bundle: true,
outdir: "dist", outdir: "dist",
platform: "node", platform: "node",

View file

@ -6,7 +6,7 @@
"build": "node esbuild.config.js", "build": "node esbuild.config.js",
"cz": "cz", "cz": "cz",
"dev": "npm run build && npm run start", "dev": "npm run build && npm run start",
"lint": "eslint --no-error-on-unmatched-pattern src/**/*.js src/*.js tests/**/*.test.js tests/**/*.js tests/*.test.js tests/*.js utils/**/*.js utils/*.js", "lint": "eslint --no-error-on-unmatched-pattern src/**/*.js src/*.js tests/**/*.test.js tests/**/*.js tests/*.test.js tests/*.js",
"lint:fix": "npm run lint -- --fix", "lint:fix": "npm run lint -- --fix",
"prepare": "husky", "prepare": "husky",
"start": "node dist/svr.js", "start": "node dist/svr.js",