rdesktop
filip mertens 1 year ago
parent 6bb9beb950
commit 89c146f1de
  1. 2
      apps/remix-ide/src/app.js
  2. 4
      apps/remix-ide/src/index.tsx
  3. 19
      apps/remixdesktop/webpack.config.js
  4. 2
      package.json

@ -78,7 +78,7 @@ class AppComponent {
constructor() { constructor() {
console.log(window.electronAPI) console.log(window.electronAPI)
console.log(window) console.log(window.api)
this.appManager = new RemixAppManager({}) this.appManager = new RemixAppManager({})
this.queryParams = new QueryParams() this.queryParams = new QueryParams()

@ -16,14 +16,14 @@ import { Storage } from '@remix-project/remix-lib'
} catch (e) { } } catch (e) { }
const theme = new ThemeModule() const theme = new ThemeModule()
theme.initTheme() theme.initTheme()
/*
render( render(
<React.StrictMode> <React.StrictMode>
<Preload></Preload> <Preload></Preload>
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById('root')
) )
*/
})() })()

@ -4,11 +4,15 @@ const TerserPlugin = require("terser-webpack-plugin")
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin") const CssMinimizerPlugin = require("css-minimizer-webpack-plugin")
// Nx plugins for webpack. // Nx plugins for webpack.
module.exports = composePlugins((config) => { module.exports = composePlugins((input) => {
config = {}
const config = {
mode: input.mode === 'production' ? 'production' : 'development',
}
config.target = 'electron-main' config.target = 'electron-main'
config.devtool = 'source-map' config.devtool = 'source-map'
config.mode = 'production'
config.output = { config.output = {
path: __dirname + '/.webpack/main', path: __dirname + '/.webpack/main',
filename: '[name].js', filename: '[name].js',
@ -20,11 +24,14 @@ module.exports = composePlugins((config) => {
index: ['./apps/remixdesktop/src/index.ts'], index: ['./apps/remixdesktop/src/index.ts'],
preload: ['./apps/remixdesktop/src/preload.ts'], preload: ['./apps/remixdesktop/src/preload.ts'],
} }
const mainEntry = config.mode === 'production'? `\`file://$\{require('path').resolve(__dirname, '..', 'renderer', 'index.html')}\``: `'http://localhost:8080'`
config.plugins= [ config.plugins= [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
MAIN_WINDOW_WEBPACK_ENTRY:`\`file://$\{require('path').resolve(__dirname, '..', 'renderer', 'index.html')}\``, MAIN_WINDOW_WEBPACK_ENTRY: mainEntry,
'process.env.MAIN_WINDOW_WEBPACK_ENTRY': `\`file://$\{require('path').resolve(__dirname, '..', 'renderer', 'index.html')}\``, 'process.env.MAIN_WINDOW_WEBPACK_ENTRY': mainEntry,
MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: `\`$\{require('path').resolve(__dirname, 'preload.js')}\``, MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: `\`$\{require('path').resolve(__dirname, 'preload.js')}\``,
'process.env.MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY': `\`$\{require('path').resolve(__dirname, '..', 'render', 'preload.js')}\``, 'process.env.MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY': `\`$\{require('path').resolve(__dirname, '..', 'render', 'preload.js')}\``,
}) })

@ -55,7 +55,7 @@
"build:e2e": "node apps/remix-ide-e2e/src/buildGroupTests.js && tsc -p apps/remix-ide-e2e/tsconfig.e2e.json", "build:e2e": "node apps/remix-ide-e2e/src/buildGroupTests.js && tsc -p apps/remix-ide-e2e/tsconfig.e2e.json",
"serve:desktop:dist": "rm -rf apps/remixdesktop/.webpack && yarn nx build remixdesktop && NX_DESKTOP_FROM_DIST=true nx build remix-ide --configuration=desktop && cp -r dist/apps/remix-ide apps/remixdesktop/.webpack/renderer && yarn electron apps/remixdesktop/.webpack/main", "serve:desktop:dist": "rm -rf apps/remixdesktop/.webpack && yarn nx build remixdesktop && NX_DESKTOP_FROM_DIST=true nx build remix-ide --configuration=desktop && cp -r dist/apps/remix-ide apps/remixdesktop/.webpack/renderer && yarn electron apps/remixdesktop/.webpack/main",
"build:desktop": "rm -rf apps/remixdesktop/.webpack && yarn nx build remixdesktop && NX_DESKTOP_FROM_DIST=true nx build remix-ide --configuration=desktop && cp -r dist/apps/remix-ide apps/remixdesktop/.webpack/renderer && cd apps/remixdesktop/ && yarn package", "build:desktop": "rm -rf apps/remixdesktop/.webpack && yarn nx build remixdesktop && NX_DESKTOP_FROM_DIST=true nx build remix-ide --configuration=desktop && cp -r dist/apps/remix-ide apps/remixdesktop/.webpack/renderer && cd apps/remixdesktop/ && yarn package",
"serve:desktop:webpack": "rm -rf apps/remixdesktop/.webpack && yarn nx build remixdesktop && yarn serve && yarn electron apps/remixdesktop", "serve:desktop": "rm -rf apps/remixdesktop/.webpack && yarn nx build remixdesktop --configuration=development && yarn electron apps/remixdesktop",
"babel": "babel", "babel": "babel",
"watch:e2e": "nodemon", "watch:e2e": "nodemon",
"bumpVersion:libs": "gulp & gulp syncLibVersions;", "bumpVersion:libs": "gulp & gulp syncLibVersions;",

Loading…
Cancel
Save