Skip to content

Commit fd5c97a

Browse files
committed
fix(lib/webpackConfig): __dirname when cross-compiling
1 parent d670450 commit fd5c97a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/webpackConfig.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const fs = require('fs')
22
const semver = require('semver')
33
const { DefinePlugin } = require('webpack')
4-
const path = require('path')
54

65
async function chainWebpack (api, pluginOptions, config) {
76
const rendererProcessChain =
@@ -11,7 +10,7 @@ async function chainWebpack (api, pluginOptions, config) {
1110
((devDependencies || {}).electron || '12.0.0').replace(/^\^/, ''),
1211
'12.0.0'
1312
)
14-
? `__dirname.replace("electron.asar\\${path.sep}renderer", "app.asar")`
13+
? '__dirname.replace(/electron\\.asar(\\\\|\\/)renderer/, "app.asar")'
1514
: 'require("electron").remote.app.getAppPath()'
1615
if (process.env.IS_ELECTRON) {
1716
if (pluginOptions.nodeIntegration) {

0 commit comments

Comments
 (0)