Electron app isn't finding CSS/JS included in package

前端 未结 3 1983
自闭症患者
自闭症患者 2021-01-05 03:41

I have an HTML5 web app that I\'m packaging up via Electron. I\'m packaging via gulp-electron.

The issue I\'m having is that when the app is built and I run it, none

3条回答
  •  死守一世寂寞
    2021-01-05 04:34

    Turns out there were a few issues with paths.

    First the CSS was using relative paths to reference images. Switching this to absolute paths did the trick. This was the same issue for the directives. Switching out relative paths with absolute paths did the trick there.

    Finally, the actual CSS and JS files not being loaded looks to be because in the main index.html there was this:

        
    

    Which was messing with things. Removing that allowed the CSS and JS to load correctly.

提交回复
热议问题