2 Star 4 Fork 2

Minar/nuxt-electron

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nuxtServer.js 574 Bytes
一键复制 编辑 原始数据 按行查看 历史
chengzhuo 提交于 2020-06-29 18:35 +08:00 . dev下热更新
const { app } = require('electron')
const fs = require('fs')
const path = require('path')
const nuxtRun = require('@nuxt/cli').run
const isProd = app.isPackaged
const rootPath = isProd
? path.resolve(app.getAppPath(), '../../')
: app.getAppPath()
const configPath = path.resolve(app.getAppPath(), 'nuxt.config.js')
const configRealPath = path.resolve(rootPath, 'nuxt.config.js')
if (!fs.existsSync(configRealPath)) {
const config = fs.readFileSync(configPath)
fs.writeFileSync(configRealPath, config)
}
module.exports = () => nuxtRun(isProd ? ['start'] : undefined)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Minar/nuxt-electron.git
git@gitee.com:Minar/nuxt-electron.git
Minar
nuxt-electron
nuxt-electron
master

搜索帮助