electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 99 forks source link

What does the "passthrough" option work with? #249

Closed mdrx-io closed 7 years ago

mdrx-io commented 7 years ago

I haven't seen it used in any examples beside "application/javascript". But I am personally looking for a workaround to a compilation error for Flash (.swf) files that I believe is indicating that electron-compile is trying to compile but does not know how to.

Failed to compile /tmp/.mount_yTkTvs/usr/bin/resources/app/src/resources/flowplayer/flowplayer.commercial-3.2.18.swf: Asked to compile /tmp/.mount_yTkTvs/usr/bin/resources/app/src/resources/flowplayer/flowplayer.commercial-3.2.18.swf in production, is this file not precompiled?
Error: Asked to compile /tmp/.mount_yTkTvs/usr/bin/resources/app/src/resources/flowplayer/flowplayer.commercial-3.2.18.swf in production, is this file not precompiled?
    at /tmp/.mount_yTkTvs/usr/bin/resources/app/node_modules/electron-compile/lib/compiler-host.js:336:15
    at Generator.next (<anonymous>)
    at step (/tmp/.mount_yTkTvs/usr/bin/resources/app/node_modules/electron-compile/lib/compiler-host.js:47:191)
    at /tmp/.mount_yTkTvs/usr/bin/resources/app/node_modules/electron-compile/lib/compiler-host.js:47:361
MarshallOfSound commented 7 years ago

Issue here isn't the passthrough, it's the fact you are trying to load a file from outside your app. This is normally an unsafe thing to do so electron-compile prevents you doing this in production.

If you want to override this you need to tell electron-compile to completely ignore certain paths / file types.

https://github.com/electron/electron-compile/pull/199