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() {
console.log(window.electronAPI)
console.log(window)
console.log(window.api)
this.appManager = new RemixAppManager({})
this.queryParams = new QueryParams()

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

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

@ -55,7 +55,7 @@
"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",
"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",
"watch:e2e": "nodemon",
"bumpVersion:libs": "gulp & gulp syncLibVersions;",

Loading…
Cancel
Save