rollup 打包问题修复

This commit is contained in:
草鞋没号
2020-09-25 11:39:39 +08:00
parent f65f27e6d5
commit 5c6d386b15
7 changed files with 55 additions and 11 deletions

View File

@@ -22,7 +22,7 @@ function createWin() {
const URL = is_dev
? `http://localhost:${process.env.PORT}` // vite 启动的服务器地址
: `file://${join(__dirname, '../../dist/render/index.html')}` // vite 构建后的静态文件地址
: `file://${join(__dirname, '../render/index.html')}` // vite 构建后的静态文件地址
win.loadURL(URL)
}

View File

@@ -1,11 +1,10 @@
import { createApp } from 'vue'
import App from './App.vue'
import './index.css'
// vite 会编译 import 的形式;所以 electron 及 node.js 内置模块用 require 形式
const { ipcRenderer } = require('electron')
const Store = require('electron-store')
import store from '/utils/store'
const store = new Store
import './index.css'
console.log('ipcRenderer:', ipcRenderer)
console.log('Store', store)

View File

@@ -0,0 +1,3 @@
/*@replace = import Store from 'electron-store'*/const Store = require('electron-store')
export default new Store