Skip to content

Commit

Permalink
fix: darwin install path
Browse files Browse the repository at this point in the history
  • Loading branch information
daretodave committed Apr 29, 2024
1 parent 3c5a543 commit 7b9561d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@electron-toolkit/utils": "^3.0.0",
"ansi-to-html": "^0.7.2",
"dompurify": "^3.1.0",
"electron-root-path": "^1.1.0",
"electron-updater": "^6.1.7",
"fs-extra": "^11.2.0",
"jsdom": "^24.0.0",
Expand Down
11 changes: 9 additions & 2 deletions src/main/vendor/webpack.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import webpack from 'webpack'

import { rootPath } from 'electron-root-path'
import { join } from 'path'
export async function compile(
scriptFile: string,
folderTarget: string,
...resolveModule: string[]
): Promise<void> {
return new Promise((resolve, reject) => {
const linux = process.platform === 'linux'
const darwin: boolean = process.platform === 'darwin'
const node_modules = join(rootPath, 'node_modules', 'ts-loader')

webpack(
{
Expand All @@ -17,7 +20,11 @@ export async function compile(
rules: [
{
test: /\.tsx?$/,
use: linux ? '/opt/mterm/node_modules/ts-loader' : './node_modules/ts-loader',
use: linux
? '/opt/mterm/node_modules/ts-loader'
: darwin
? node_modules
: './node_modules/ts-loader',
exclude: /node_modules/
}
]
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2628,6 +2628,11 @@ electron-builder@^24.9.1:
simple-update-notifier "2.0.0"
yargs "^17.6.2"

electron-is-packaged@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/electron-is-packaged/-/electron-is-packaged-1.0.2.tgz#d4efc0dc14991ab981de65f52271badf92323c7e"
integrity sha512-JZpV9QgVsehop7tm3KDll2/iJ9K3e7mL+jm6E3gA96zurIhxv3FZ0kxJK0eGL9c3SYORU1rN+/q2Ia8/v62Pjw==

[email protected]:
version "24.13.1"
resolved "https://registry.npmjs.org/electron-publish/-/electron-publish-24.13.1.tgz"
Expand All @@ -2641,6 +2646,13 @@ [email protected]:
lazy-val "^1.0.5"
mime "^2.5.2"

electron-root-path@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/electron-root-path/-/electron-root-path-1.1.0.tgz#a413b1ad50cbe09cb2b723ea1aacdebad47622f8"
integrity sha512-hx9BU0cS36XV4EmIrHhYObADq2gMPB96dPjZ71ROfIbVp56KC058dDR38YY2xaB3M94ATa0w6bWyDBBYrKsYKw==
dependencies:
electron-is-packaged "^1.0.2"

electron-to-chromium@^1.4.668:
version "1.4.731"
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.731.tgz"
Expand Down

0 comments on commit 7b9561d

Please sign in to comment.