Skip to content

Commit

Permalink
optimizing build size (80MB -> 45MB)
Browse files Browse the repository at this point in the history
  • Loading branch information
LamkasDev committed Jan 25, 2021
1 parent f7195d6 commit 27fb5bf
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 17,586 deletions.
16,638 changes: 0 additions & 16,638 deletions client/package-lock.json

This file was deleted.

20 changes: 6 additions & 14 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
{
"name": "LiquidChat",
"author": "LamkasDev",
"description": "An open-source chatting app",
"version": "0.1.0",
"proxy": "http://localhost:8080",
"proxy": "https://nekonetwork.net:8080",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.19.2",
"electron-is-dev": "^1.2.0",
"electron-log": "^4.2.4",
"electron-updater": "^4.3.4",
"electron-webrtc": "^0.3.0",
"mediasoup-client": "^3.6.20",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-movable": "^2.5.1",
"react-scripts": "3.4.1",
"react-twemoji": "^0.3.0",
"socket.io-client": "^2.3.0",
"websocket": "^1.0.32"
"socket.io-client": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -76,7 +67,8 @@
"babel-loader": "^8.1.0",
"electron": "7.0.0",
"electron-builder": "^22.8.0",
"webpack-cli": "^3.3.12"
"webpack-cli": "^3.3.12",
"react-scripts": "3.4.1"
},
"postinstall": "electron-builder install-app-deps",
"main": "./public/electron.js",
Expand Down
5 changes: 2 additions & 3 deletions client/public/electron.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const electron = require('electron');
const isDev = require('electron-is-dev');
const path = require('path');

let app = electron.app;
Expand All @@ -9,13 +8,13 @@ let tray;
function createWindow() {
mainWindow = new electron.BrowserWindow({ width: 900, height: 680, webPreferences: { preload: path.join(__dirname, "preload.js"), zoomFactor: 0.8 }, frame: false });
mainWindow.setMenu(null);
mainWindow.loadURL(isDev ? 'http://localhost:3000' : `https://nekonetwork.net`);
mainWindow.loadURL(`https://nekonetwork.net`);

mainWindow.on('closed', () => mainWindow = null);
}

app.on('ready', () => {
tray = new electron.Tray(`${path.join(__dirname, '../logo192_.png')}`)
tray = new electron.Tray(`${path.join(__dirname, '../logo192.png')}`)
const contextMenu = new electron.Menu();
contextMenu.append(new electron.MenuItem({ label: "LiquidChat", type: "normal" }))
contextMenu.append(new electron.MenuItem({ type: "separator" }))
Expand Down
Binary file modified client/public/favicon.ico
Binary file not shown.
Binary file removed client/public/favicon_.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html lang="en" class="bgColor">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon_.ico" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="An open-source chatting platform-"/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192_.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://kit.fontawesome.com/1c9144b004.js" crossorigin="anonymous"></script>
Expand Down
Binary file modified client/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed client/public/logo192_.png
Binary file not shown.
Binary file removed client/public/logo512.png
Binary file not shown.
6 changes: 3 additions & 3 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class App extends React.Component {

//Setup menu bar
if(window.navigator.userAgent.includes("LiquidChat")) {
if(this.state.registeredHooks === true) {
if(this.state.registeredHooks === false) {
const minimizeButton = document.getElementById("minimize-btn");
const maxUnmaxButton = document.getElementById("max-unmax-btn");
const closeButton = document.getElementById("close-btn");
Expand All @@ -288,9 +288,9 @@ class App extends React.Component {
closeButton.addEventListener("click", e => {
window.closeWindow();
});

document.getElementById("web-header").remove();
}

document.getElementById("web-header").remove();
} else {
document.getElementById("app-header").remove();
}
Expand Down
1 change: 1 addition & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@ code {

.overlaybg {
background: url("https://nekonetwork.net:8081/bg.png");
z-index: -1;
}

.statusBorder {
Expand Down
Loading

0 comments on commit 27fb5bf

Please sign in to comment.