Skip to content

Commit 6188f08

Browse files
christophpredevelar
authored andcommitted
fix: “__static” not work as expected in production (#114) (#189)
For the renderer process and in production the __static variable should also point to process.resourcesPath and not to the configurator.projectDir, because /static files are located relative to the packaged electron app.
1 parent a295fb4 commit 6188f08

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packages/electron-webpack/src/targets/RendererTarget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class RendererTarget extends BaseRendererTarget {
117117

118118
if (configurator.isProduction) {
119119
configurator.plugins.push(new DefinePlugin({
120-
__static: `"${path.join(configurator.projectDir, "static").replace(/\\/g, "\\\\")}"`
120+
__static: `process.resourcesPath + "/static"`
121121
}))
122122
}
123123
else {

0 commit comments

Comments
 (0)