react-native-electron-platform 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +26 -2
- package/src/modules/windowManager.js +2 -3
- package/webpack.config.mjs +22 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-electron-platform",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "A boilerplate and utilities for running React Native applications in Electron",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"scripts": {
|
|
@@ -9,10 +9,30 @@
|
|
|
9
9
|
},
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react-native",
|
|
12
|
+
"react-native-desktop",
|
|
13
|
+
"react-native-electron",
|
|
12
14
|
"electron",
|
|
15
|
+
"electron-react-native",
|
|
13
16
|
"desktop",
|
|
17
|
+
"cross-platform",
|
|
18
|
+
"universal-app",
|
|
19
|
+
"react-native-web",
|
|
20
|
+
"react-native-windows",
|
|
21
|
+
"react-native-macos",
|
|
22
|
+
"desktop-app",
|
|
23
|
+
"desktop-framework",
|
|
24
|
+
"mobile-to-desktop",
|
|
25
|
+
"react-native-boilerplate",
|
|
26
|
+
"electron-boilerplate",
|
|
27
|
+
"multi-platform",
|
|
28
|
+
"android",
|
|
29
|
+
"ios",
|
|
30
|
+
"windows",
|
|
31
|
+
"macos",
|
|
32
|
+
"linux",
|
|
14
33
|
"web",
|
|
15
|
-
"
|
|
34
|
+
"javascript-framework",
|
|
35
|
+
"react-native-tooling"
|
|
16
36
|
],
|
|
17
37
|
"author": "PRAFULDAS M M",
|
|
18
38
|
"license": "JESCON TECHNOLOGIES PVT LTD",
|
|
@@ -38,6 +58,10 @@
|
|
|
38
58
|
"@babel/preset-env": "^7.0.0",
|
|
39
59
|
"@babel/preset-react": "^7.0.0",
|
|
40
60
|
"@babel/preset-typescript": "^7.0.0",
|
|
61
|
+
"@babel/plugin-transform-class-properties": "^7.0.0",
|
|
62
|
+
"@babel/plugin-transform-private-methods": "^7.0.0",
|
|
63
|
+
"@babel/plugin-transform-private-property-in-object": "^7.0.0",
|
|
64
|
+
"@babel/plugin-transform-runtime": "^7.0.0",
|
|
41
65
|
"babel-loader": "^9.0.0",
|
|
42
66
|
"react-refresh": "^0.14.0",
|
|
43
67
|
"file-loader": "^6.0.0"
|
|
@@ -2,7 +2,6 @@ import { BrowserWindow, screen, session } from "electron";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import { app, dialog } from "electron";
|
|
5
|
-
import { ApiUrl } from "react-native-electron-platform/webpack.config.mjs";
|
|
6
5
|
|
|
7
6
|
export function createMainWindow(__dirname) {
|
|
8
7
|
const primaryDisplay = screen.getPrimaryDisplay();
|
|
@@ -91,8 +90,8 @@ function loadAppContent(mainWindow, __dirname) {
|
|
|
91
90
|
const isDev = isDevMode();
|
|
92
91
|
|
|
93
92
|
if (isDev) {
|
|
94
|
-
mainWindow.loadURL(
|
|
95
|
-
console.log("DEV MODE:"
|
|
93
|
+
mainWindow.loadURL("http://localhost:5001");
|
|
94
|
+
console.log("DEV MODE: http://localhost:5001");
|
|
96
95
|
} else {
|
|
97
96
|
const possiblePaths = [
|
|
98
97
|
path.join(__dirname, "web-build/index.html"),
|
package/webpack.config.mjs
CHANGED
|
@@ -74,6 +74,7 @@ export default {
|
|
|
74
74
|
|
|
75
75
|
module: {
|
|
76
76
|
rules: [
|
|
77
|
+
// Your source files
|
|
77
78
|
// Your source files
|
|
78
79
|
{
|
|
79
80
|
test: /\.(js|jsx|ts|tsx)$/,
|
|
@@ -81,7 +82,17 @@ export default {
|
|
|
81
82
|
use: {
|
|
82
83
|
loader: 'babel-loader',
|
|
83
84
|
options: {
|
|
84
|
-
|
|
85
|
+
presets: [
|
|
86
|
+
'@babel/preset-env',
|
|
87
|
+
'@babel/preset-react',
|
|
88
|
+
'@babel/preset-typescript',
|
|
89
|
+
],
|
|
90
|
+
plugins: [
|
|
91
|
+
['@babel/plugin-transform-class-properties', { loose: true }],
|
|
92
|
+
['@babel/plugin-transform-private-methods', { loose: true }],
|
|
93
|
+
['@babel/plugin-transform-private-property-in-object', { loose: true }],
|
|
94
|
+
'@babel/plugin-transform-runtime',
|
|
95
|
+
],
|
|
85
96
|
},
|
|
86
97
|
},
|
|
87
98
|
},
|
|
@@ -93,7 +104,16 @@ export default {
|
|
|
93
104
|
use: {
|
|
94
105
|
loader: 'babel-loader',
|
|
95
106
|
options: {
|
|
96
|
-
|
|
107
|
+
presets: [
|
|
108
|
+
'@babel/preset-env',
|
|
109
|
+
'@babel/preset-react',
|
|
110
|
+
'@babel/preset-typescript',
|
|
111
|
+
],
|
|
112
|
+
plugins: [
|
|
113
|
+
['@babel/plugin-transform-class-properties', { loose: true }],
|
|
114
|
+
['@babel/plugin-transform-private-methods', { loose: true }],
|
|
115
|
+
['@babel/plugin-transform-private-property-in-object', { loose: true }],
|
|
116
|
+
],
|
|
97
117
|
},
|
|
98
118
|
},
|
|
99
119
|
},
|