react-native-electron-platform 0.0.23 → 0.0.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-electron-platform",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "A boilerplate and utilities for running React Native applications in Electron",
5
5
  "main": "index.mjs",
6
6
  "scripts": {
@@ -38,6 +38,10 @@
38
38
  "@babel/preset-env": "^7.0.0",
39
39
  "@babel/preset-react": "^7.0.0",
40
40
  "@babel/preset-typescript": "^7.0.0",
41
+ "@babel/plugin-transform-class-properties": "^7.0.0",
42
+ "@babel/plugin-transform-private-methods": "^7.0.0",
43
+ "@babel/plugin-transform-private-property-in-object": "^7.0.0",
44
+ "@babel/plugin-transform-runtime": "^7.0.0",
41
45
  "babel-loader": "^9.0.0",
42
46
  "react-refresh": "^0.14.0",
43
47
  "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();
@@ -24,7 +23,7 @@ export function createMainWindow(__dirname) {
24
23
  nodeIntegration: false,
25
24
  contextIsolation: true,
26
25
  sandbox: false,
27
- webSecurity: true,
26
+ webSecurity: false,
28
27
  disableBlinkFeatures: "AutoLoadIconsForPage",
29
28
  nativeWindowOpen: true,
30
29
  spellcheck: true,
@@ -91,8 +90,8 @@ function loadAppContent(mainWindow, __dirname) {
91
90
  const isDev = isDevMode();
92
91
 
93
92
  if (isDev) {
94
- mainWindow.loadURL(ApiUrl);
95
- console.log("DEV MODE:", ApiUrl);
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"),
@@ -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
- plugins: ['react-refresh/babel'],
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
- plugins: ['react-refresh/babel'],
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
  },