从webpack迁移到vite

This commit is contained in:
lyswhut
2023-08-07 18:49:14 +08:00
parent 31e16a7ed7
commit 028bf5919d
166 changed files with 3071 additions and 11869 deletions
+3 -3
View File
@@ -18,20 +18,20 @@ const initTables = (db: Database.Database) => {
// 打开、初始化数据库
export const init = (lxDataPath: string): boolean | null => {
const databasePath = path.join(lxDataPath, 'lx.data.db')
const nativeBinding = path.join(__dirname, '../node_modules/better-sqlite3/build/Release/better_sqlite3.node')
const nativeBinding = path.join(__dirname, '../../node_modules/better-sqlite3/build/Release/better_sqlite3.node')
let dbFileExists = true
try {
db = new Database(databasePath, {
fileMustExist: true,
nativeBinding,
verbose: global.isDev ? console.log : undefined,
verbose: process.env.NODE_ENV !== 'production' ? console.log : undefined,
})
} catch (error) {
console.log(error)
db = new Database(databasePath, {
nativeBinding,
verbose: global.isDev ? console.log : undefined,
verbose: process.env.NODE_ENV !== 'production' ? console.log : undefined,
})
initTables(db)
dbFileExists = false