Skip to content

Commit

Permalink
fix: “__static” not work as expected in production (#114) (#189)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
christophpre authored and develar committed Aug 28, 2018
1 parent a295fb4 commit 6188f08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/electron-webpack/src/targets/RendererTarget.ts
Expand Up @@ -117,7 +117,7 @@ export class RendererTarget extends BaseRendererTarget {

if (configurator.isProduction) {
configurator.plugins.push(new DefinePlugin({
__static: `"${path.join(configurator.projectDir, "static").replace(/\\/g, "\\\\")}"`
__static: `process.resourcesPath + "/static"`
}))
}
else {
Expand Down

0 comments on commit 6188f08

Please sign in to comment.