Added production config and fixed pack script (#32)

This commit is contained in:
Akshit Kr Nagpal 2018-05-24 19:32:27 +05:30 committed by Saúl Ibarra Corretgé
parent 42be533614
commit ff3b9d9251
4 changed files with 26 additions and 15 deletions

10
main.js
View File

@ -4,6 +4,8 @@ const electron = require('electron');
const APP = electron.app;
const BrowserWindow = electron.BrowserWindow;
const isDev = require('electron-is-dev');
const {
setupAlwaysOnTopMain
} = require('jitsi-meet-electron-utils');
@ -11,11 +13,17 @@ const {
const path = require('path');
const URL = require('url');
/**
* Path to root directory
*/
const basePath = isDev ? __dirname : electron.app.getAppPath();
/**
* URL for index.html which will be our entry point.
*/
const indexURL = URL.format({
pathname: path.resolve(__dirname, './build/index.html'),
pathname: path.resolve(basePath, './build/index.html'),
protocol: 'file:',
slashes: true
});

21
package-lock.json generated
View File

@ -3017,6 +3017,11 @@
"sumchecker": "1.3.1"
}
},
"electron-is-dev": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-0.3.0.tgz",
"integrity": "sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4="
},
"electron-osx-sign": {
"version": "0.4.10",
"resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz",
@ -6155,15 +6160,6 @@
"postis": "2.2.0",
"prebuild-install": "2.5.3",
"robotjs": "github:jitsi/robotjs#5cc469f655669e728b61271c2c57ce97d62976fd"
},
"dependencies": {
"robotjs": {
"version": "github:jitsi/robotjs#5cc469f655669e728b61271c2c57ce97d62976fd",
"requires": {
"nan": "2.10.0",
"prebuild-install": "2.5.3"
}
}
}
},
"js-tokens": {
@ -8827,6 +8823,13 @@
"inherits": "2.0.3"
}
},
"robotjs": {
"version": "github:jitsi/robotjs#5cc469f655669e728b61271c2c57ce97d62976fd",
"requires": {
"nan": "2.10.0",
"prebuild-install": "2.5.3"
}
},
"run-async": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",

View File

@ -2,13 +2,13 @@
"name": "jitsi-meet-electron",
"version": "0.0.0",
"description": "Electron application for Jitsi Meet",
"main": "main.js",
"main": "build/main.js",
"productName": "Jitsi Meet",
"scripts": {
"start": "webpack --config ./webpack.config.js --progress && electron ./build/main.js",
"start": "webpack --config ./webpack.config.js --mode development && electron ./build/main.js",
"clean": "rm -rf node_modules",
"lint": "eslint .",
"pack": "electron-packager .",
"pack": "webpack --config ./webpack.config.js --mode production && electron-packager .",
"postinstall": "electron-rebuild",
"validate": "npm ls"
},
@ -30,6 +30,7 @@
"readmeFilename": "README.md",
"license": "Apache-2.0",
"dependencies": {
"electron-is-dev": "0.3.0",
"jitsi-meet-electron-utils": "jitsi/jitsi-meet-electron-utils",
"react": "16.3.2",
"react-dom": "16.3.2"

View File

@ -9,7 +9,6 @@ const commonConfig = {
node: {
__dirname: true
},
mode: 'development',
module: {
rules: [
{
@ -50,7 +49,7 @@ module.exports = [
commonConfig),
Object.assign({
target: 'electron-renderer',
entry: { renderer: './app/index.js' },
entry: { app: './app/index.js' },
plugins: [
new HtmlWebpackPlugin({
template: './app/index.html'