Added: picgo-core-ipc & fixed dynamic require bug in picgo

This commit is contained in:
Molunerfinn
2018-09-18 18:48:55 +08:00
parent cb32d43be4
commit aea0c3661d
4 changed files with 117 additions and 17 deletions

View File

@@ -4,10 +4,13 @@ import {
BrowserWindow,
ipcMain
} from 'electron'
import PicGo from 'picgo'
import path from 'path'
import fecha from 'fecha'
// eslint-disable-next-line
const requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require
const PicGo = requireFunc('picgo')
const renameURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080/#rename-page` : `file://${__dirname}/index.html#rename-page`
const createRenameWindow = () => {