Skip to content

Commit

Permalink
fix(lib/webpackConfig): __dirname when cross-compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
nklayman committed Mar 27, 2021
1 parent d670450 commit fd5c97a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/webpackConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const fs = require('fs')
const semver = require('semver')
const { DefinePlugin } = require('webpack')
const path = require('path')

async function chainWebpack (api, pluginOptions, config) {
const rendererProcessChain =
Expand All @@ -11,7 +10,7 @@ async function chainWebpack (api, pluginOptions, config) {
((devDependencies || {}).electron || '12.0.0').replace(/^\^/, ''),
'12.0.0'
)
? `__dirname.replace("electron.asar\\${path.sep}renderer", "app.asar")`
? '__dirname.replace(/electron\\.asar(\\\\|\\/)renderer/, "app.asar")'
: 'require("electron").remote.app.getAppPath()'
if (process.env.IS_ELECTRON) {
if (pluginOptions.nodeIntegration) {
Expand Down

0 comments on commit fd5c97a

Please sign in to comment.