mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	dev: Fix npm start-electron script
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
				
			|||||||
const fs = require("fs-extra");
 | 
					import fs from "fs-extra";
 | 
				
			||||||
const path = require("path");
 | 
					import path from "path";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const DEST_DIR = "./dist";
 | 
					const DEST_DIR = "./dist";
 | 
				
			||||||
const DEST_DIR_SRC = path.join(DEST_DIR, "src");
 | 
					const DEST_DIR_SRC = path.join(DEST_DIR, "src");
 | 
				
			||||||
@@ -15,6 +15,12 @@ async function copyNodeModuleFileOrFolder(source: string) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const copy = async () => {
 | 
					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"];
 | 
					  const filesToCopy = ["config-sample.ini"];
 | 
				
			||||||
  for (const file of filesToCopy) {
 | 
					  for (const file of filesToCopy) {
 | 
				
			||||||
    console.log(`Copying ${file}`);
 | 
					    console.log(`Copying ${file}`);
 | 
				
			||||||
@@ -27,7 +33,7 @@ const copy = async () => {
 | 
				
			|||||||
    await fs.copy(dir, path.join(DEST_DIR, dir));
 | 
					    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) {
 | 
					  for (const dir of srcDirsToCopy) {
 | 
				
			||||||
    console.log(`Copying ${dir}`);
 | 
					    console.log(`Copying ${dir}`);
 | 
				
			||||||
    await fs.copy(dir, path.join(DEST_DIR_SRC, path.basename(dir)));
 | 
					    await fs.copy(dir, path.join(DEST_DIR_SRC, path.basename(dir)));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,8 @@
 | 
				
			|||||||
	  "resolveJsonModule": true,
 | 
						  "resolveJsonModule": true,
 | 
				
			||||||
	  "lib": ["ES2022"],
 | 
						  "lib": ["ES2022"],
 | 
				
			||||||
	  "downlevelIteration": true,
 | 
						  "downlevelIteration": true,
 | 
				
			||||||
	  "skipLibCheck": true
 | 
						  "skipLibCheck": true,
 | 
				
			||||||
 | 
						  "esModuleInterop": true
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	"include": [
 | 
						"include": [
 | 
				
			||||||
      "./src/**/*.js",
 | 
					      "./src/**/*.js",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user