electron package is modified

This commit is contained in:
병준 박 2019-12-31 14:15:29 +09:00
parent 2c7797d8f8
commit 32f1400f84
42 changed files with 36 additions and 22 deletions

View File

@ -82,7 +82,7 @@ const mainConfig: webpack.Configuration = {
), ),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ {
from: 'ucap-webmessenger-electron/resources/**/*', from: 'ucap-webmessenger-electron/assets/**/*',
to: path.resolve(__dirname, '..', 'dist'), to: path.resolve(__dirname, '..', 'dist'),
context: 'electron-projects' context: 'electron-projects'
} }

View File

@ -23,9 +23,25 @@
"!**/.awcache", "!**/.awcache",
"!**/.vscode", "!**/.vscode",
"!config/", "!config/",
"!dist/",
"!docker/", "!docker/",
"!tsconfig.json", "!tsconfig.json",
"!tslint.json" "!tslint.json",
{
"filter": ["**/*"],
"from": "./dist/ucap-webmessenger-app/",
"to": "./renderer/"
},
{
"filter": ["**/*"],
"from": "./dist/ucap-webmessenger-electron/",
"to": "./electron/"
},
{
"filter": ["**/*"],
"from": "./config/build/${os}/icon/daesang/",
"to": "./assets/icon/"
}
], ],
"protocols": { "protocols": {
"name": "DS Talk", "name": "DS Talk",

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -165,11 +165,7 @@ export class AppWindow {
} else { } else {
this.window.loadURL( this.window.loadURL(
url.format({ url.format({
pathname: path.join( pathname: path.join(__dirname, '..', 'renderer/index.html'),
__dirname,
'..',
'ucap-webmessenger-app/index.html'
),
protocol: 'file:', protocol: 'file:',
slashes: true slashes: true
}) })

View File

@ -52,13 +52,18 @@ const appIconPath = __LINUX__
? path.join( ? path.join(
__dirname, __dirname,
'../../', '../../',
'config/build/linux/icon/woori/', 'config/build/linux/icon/daesang/',
'256x256.png' '256x256.png'
) )
: path.join(__dirname, 'resources/linuxicon', '256x256.png') : path.join(__dirname, '..', '/assets/icon/', '256x256.png')
: __DEV__ : __DEV__
? path.join(__dirname, 'resources/image', '64_64.png') ? path.join(
: path.join(__dirname, 'resources/image', '64_64.png'); __dirname,
'../../',
'config/build/win/icon/daesang/',
'16x16.ico'
)
: path.join(__dirname, '..', '/assets/icon/', '16x16.ico');
let appWindow: AppWindow | null = null; let appWindow: AppWindow | null = null;
let appTray: Tray | null = null; let appTray: Tray | null = null;
@ -266,12 +271,12 @@ app.on(ElectronAppChannel.Ready, () => {
notificationService.options.defaultWindow.webPreferences.preload = path.join( notificationService.options.defaultWindow.webPreferences.preload = path.join(
__dirname, __dirname,
'resources/notification/preload.js' 'assets/notification/preload.js'
); );
notificationService.templatePath = path.join( notificationService.templatePath = path.join(
__dirname, __dirname,
'resources/notification/template.html' 'assets/notification/template.html'
); );
updateWindowService = new ElectronUpdateWindowService({ updateWindowService = new ElectronUpdateWindowService({
@ -299,7 +304,7 @@ app.on(ElectronAppChannel.Ready, () => {
updateWindowService.templatePath = path.join( updateWindowService.templatePath = path.join(
__dirname, __dirname,
'resources/update-window/template.html' 'assets/update-window/template.html'
); );
// updateWindowService.show(); // updateWindowService.show();
@ -589,15 +594,12 @@ ipcMain.on(
text: noti.contents, text: noti.contents,
image: image:
noti.image || noti.image ||
path.join( path.join(__dirname, 'assets/notification/images/img_nophoto_50.png'),
__dirname,
'resources/notification/images/img_nophoto_50.png'
),
sound: noti.useSound sound: noti.useSound
? path.join( ? path.join(
'file://', 'file://',
__dirname, __dirname,
'resources/notification/sounds/messageAlarm.mp3' 'assets/notification/sounds/messageAlarm.mp3'
) )
: '', : '',
displayTime: !!noti.displayTime ? noti.displayTime : undefined, displayTime: !!noti.displayTime ? noti.displayTime : undefined,

View File

@ -3,7 +3,7 @@ import * as path from 'path';
// tslint:disable-next-line: variable-name // tslint:disable-next-line: variable-name
const _root = __DEV__ const _root = __DEV__
? path.resolve(__dirname, '..', '..') ? path.resolve(__dirname, '..', '..')
: path.resolve(__dirname, '..', '..'); : path.resolve(__dirname, '..');
export function root(...paths: string[]) { export function root(...paths: string[]) {
const args = Array.prototype.slice.call(paths, 0); const args = Array.prototype.slice.call(paths, 0);

View File

@ -145,5 +145,5 @@
"webpack-node-externals": "^1.7.2", "webpack-node-externals": "^1.7.2",
"zone.js": "~0.9.1" "zone.js": "~0.9.1"
}, },
"main": "./dist/ucap-webmessenger-electron/main.js" "main": "./electron/main.js"
} }

View File

@ -19,7 +19,7 @@ export function createTranslateLoader(nativeService: NativeService) {
break; break;
case NativeType.Electron: case NativeType.Electron:
prefix = environment.production prefix = environment.production
? '/dist/ucap-webmessenger-app/assets/i18n/' ? '/renderer/assets/i18n/'
: '/projects/ucap-webmessenger-app/src/assets/i18n/'; : '/projects/ucap-webmessenger-app/src/assets/i18n/';
break; break;