pack: vutron now uses the vite compiler
This commit is contained in:
1 parent
fce96211ba
commit
02b13d8fb7
30 files changed
+2064
-11005
No files matched your search
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
<% if (!htmlWebpackPlugin.options.isDevelopment) { %>
|
||||
<script>
|
||||
window.__static = '<%= htmlWebpackPlugin.options.staticPath %>'
|
||||
</script>
|
||||
<% } %>
|
||||
</html>
|
||||
@@ -1,12 +1,7 @@
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
import Constants from './utils/Constants'
|
||||
import { join } from 'path'
|
||||
import * as electronRemote from '@electron/remote/main'
|
||||
|
||||
const getAppIcon = () => {
|
||||
return join(__static, Constants.APP_ICON)
|
||||
}
|
||||
|
||||
const exitApp = (mainWindow) => {
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.hide()
|
||||
@@ -18,7 +13,6 @@ const exitApp = (mainWindow) => {
|
||||
export const createMainWindow = async (mainWindow) => {
|
||||
mainWindow = new BrowserWindow({
|
||||
title: Constants.APP_NAME,
|
||||
icon: getAppIcon(),
|
||||
show: false,
|
||||
width: Constants.IS_DEV_ENV ? 1500 : 1200,
|
||||
height: 650,
|
||||
@@ -64,7 +58,6 @@ export const createErrorWindow = async (errorWindow, mainWindow, details) => {
|
||||
|
||||
errorWindow = new BrowserWindow({
|
||||
title: Constants.APP_NAME,
|
||||
icon: getAppIcon(),
|
||||
show: false,
|
||||
resizable: Constants.IS_DEV_ENV,
|
||||
webPreferences: Constants.DEFAULT_WEB_PREFERENCES
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { app } from 'electron'
|
||||
import './index'
|
||||
import * as electronDevtoolsInstaller from 'electron-devtools-installer'
|
||||
|
||||
app.on('ready', async () => {
|
||||
await electronDevtoolsInstaller.default(electronDevtoolsInstaller.VUEJS_DEVTOOLS)
|
||||
.catch(e => {
|
||||
console.log(`Failed to install Vue Devtools \n(${e})`)
|
||||
})
|
||||
})
|
||||
@@ -1,7 +1,4 @@
|
||||
import 'v8-compile-cache'
|
||||
import { app } from 'electron'
|
||||
import { join, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
import Constants from './utils/Constants'
|
||||
import { createErrorWindow, createMainWindow } from './MainRunner'
|
||||
import Menus from './utils/Menus'
|
||||
@@ -10,11 +7,6 @@ let mainWindow
|
||||
let errorWindow
|
||||
|
||||
app.on('ready', () => {
|
||||
if (!Constants.IS_DEV_ENV) {
|
||||
global.__static = join(dirname(fileURLToPath(import.meta.url)), '/static')
|
||||
.replace(/\\/g, '\\\\')
|
||||
}
|
||||
|
||||
Menus.macOSDisableDefaultMenuItem()
|
||||
|
||||
mainWindow = createMainWindow(mainWindow)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { platform } from 'os'
|
||||
import { join } from 'path'
|
||||
|
||||
export default class Constants {
|
||||
static APP_NAME = 'Vutron'
|
||||
static APP_ICON = 'app-icon.png'
|
||||
|
||||
static IS_DEV_ENV = process.env.NODE_ENV === 'development'
|
||||
|
||||
@@ -15,6 +15,6 @@ export default class Constants {
|
||||
enableRemoteModule: true
|
||||
}
|
||||
|
||||
static APP_INDEX_URL_DEV = 'http://localhost:9080/index.html'
|
||||
static APP_INDEX_URL_PROD = './dist/electron/index.html'
|
||||
static APP_INDEX_URL_DEV = 'http://localhost:5173/index.html'
|
||||
static APP_INDEX_URL_PROD = join(__dirname, '../index.html')
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,9 +1,9 @@
|
||||
<script setup>
|
||||
// import { useI18n } from 'vue-i18n'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useTheme } from 'vuetify'
|
||||
import Utils from '../../assets/js/utils'
|
||||
import Utils from '../../utils'
|
||||
|
||||
// const { locale } = useI18n()
|
||||
const { locale } = useI18n()
|
||||
const theme = useTheme()
|
||||
|
||||
const handleChangeTheme = () => {
|
||||
@@ -11,7 +11,11 @@ const handleChangeTheme = () => {
|
||||
}
|
||||
|
||||
const handleChangeLanguage = () => {
|
||||
// locale.value = 'en' // TODO
|
||||
if (locale.value === 'en') {
|
||||
locale.value = 'ko'
|
||||
} else {
|
||||
locale.value = 'en'
|
||||
}
|
||||
}
|
||||
|
||||
const handleAbout = async () => {
|
||||
@@ -29,7 +33,7 @@ const handleAbout = async () => {
|
||||
<img
|
||||
alt="logo"
|
||||
class="ma-auto h-auto w-75"
|
||||
src="~@/assets/img/vutron-logo.png"
|
||||
src="/images/vutron-logo.png"
|
||||
>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
@@ -47,7 +51,6 @@ const handleAbout = async () => {
|
||||
<v-col cols="4">
|
||||
<v-btn
|
||||
block
|
||||
disabled
|
||||
color="primary"
|
||||
@click="handleChangeLanguage"
|
||||
>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
<script type="module" src="./main.js"></script>
|
||||
</html>
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
import { createI18n } from 'vue-i18n'
|
||||
import en from '../../locales/en.json'
|
||||
import ko from '../../locales/ko.json'
|
||||
import Utils from '../assets/js/utils'
|
||||
import en from '../locales/en.json'
|
||||
import ko from '../locales/ko.json'
|
||||
import Utils from '../utils'
|
||||
|
||||
export default createI18n({
|
||||
legacy: false,
|
||||
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user