electron-userland / electron-webpack-quick-start

A bare minimum project structure to get started developing with electron-webpack.
https://webpack.electron.build/
730 stars 258 forks source link

__static doesn't work for images in development #49

Closed cmeeren closed 5 years ago

cmeeren commented 5 years ago

How are we supposed to use simple images?

I'm trying to add a simple <img src="..." to my app. I have placed myimg.png in the static folder. When I set the image source to simply myimg.png, everything works in dev mode, but the image does not show up in production (presumably since it's in a resources subfolder).

On the other hand, if I prefix the filename with __static, it works in production mode, but in debug mode I get the following error in Chrome DevTools:

Not allowed to load local resource: file:///<repo folder>/static/myimg.png

cmeeren commented 5 years ago

Sorry, wrong repo.