Skip to content

Commit 9743d25

Browse files
committed
fix(lib/webpackConfig): __dirname on windows
1 parent 3e09e13 commit 9743d25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/webpackConfig.js

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

56
async function chainWebpack (api, pluginOptions, config) {
67
const rendererProcessChain =
@@ -10,7 +11,7 @@ async function chainWebpack (api, pluginOptions, config) {
1011
((devDependencies || {}).electron || '12.0.0').replace(/^\^/, ''),
1112
'12.0.0'
1213
)
13-
? '__dirname.replace("electron.asar/renderer", "app.asar")'
14+
? `__dirname.replace("electron.asar${path.sep()}renderer", "app.asar")`
1415
: 'require("electron").remote.app.getAppPath()'
1516
if (process.env.IS_ELECTRON) {
1617
if (pluginOptions.nodeIntegration) {

0 commit comments

Comments
 (0)