Skip to content

Commit

Permalink
dev: Fix npm start-electron script
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Jul 14, 2024
1 parent f40257b commit 595402a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 10 additions & 4 deletions bin/copy-dist.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs-extra");
const path = require("path");
import fs from "fs-extra";
import path from "path";

const DEST_DIR = "./dist";
const DEST_DIR_SRC = path.join(DEST_DIR, "src");
Expand All @@ -15,6 +15,12 @@ async function copyNodeModuleFileOrFolder(source: string) {
}

const copy = async () => {
for (const srcFile of fs.readdirSync("build")) {
const destFile = path.join(DEST_DIR, path.basename(srcFile));
console.log(`Copying source ${srcFile} -> ${destFile}.`);
fs.copySync(path.join("build", srcFile), destFile, { recursive: true });
}

const filesToCopy = ["config-sample.ini"];
for (const file of filesToCopy) {
console.log(`Copying ${file}`);
Expand All @@ -27,11 +33,11 @@ const copy = async () => {
await fs.copy(dir, path.join(DEST_DIR, dir));
}

const srcDirsToCopy = ["./src/public", "./src/views"];
const srcDirsToCopy = ["./src/public", "./src/views", "./build"];
for (const dir of srcDirsToCopy) {
console.log(`Copying ${dir}`);
await fs.copy(dir, path.join(DEST_DIR_SRC, path.basename(dir)));
}
}

const nodeModulesFile = [
"node_modules/react/umd/react.production.min.js",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"resolveJsonModule": true,
"lib": ["ES2022"],
"downlevelIteration": true,
"skipLibCheck": true
"skipLibCheck": true,
"esModuleInterop": true
},
"include": [
"./src/**/*.js",
Expand Down

0 comments on commit 595402a

Please sign in to comment.