[Cli] exec electron with main.js from url


#1

The scenario is this, i have a Webpack app, it serves it’s bundles with WebpackDevServer through the url http://localhost:3000/main.js.

I want to use such file as the mainProcess, if i had such file in disk i would use this command:

NODE_ENV=development electron dist/main.js

However if i try the same with the url version like this:

NODE_ENV=development electron http://localhost:3000/main.js

It outputs such file contents, in the next image the app on top is the expected output with the file on disk, the second lower is the app when trying to use the main from an url:

Maybe it has to do with electron not detecting the file’s extension, mayme mime type or i’m missing a flag to tell electron that it is the main file?