0

I am currently developing nodejs app which will be hosted on iis, using iisnode. I am having such a problem, this is part of my server.js:

app.listen(process.env.PORT);

process.env.PORT is passed by IIS, so at the moment when I locally building webpack package I have no port.

I deploy the build-ed package on my server, but looking at server.bundle.js, I can see:

app.listen(undefined);

now IIS can not start the application..

Is there any option to set webpack bundle-ed package to expect node process variable to be passed on the run?

Or maybe I am doing something wrong here?

1 Answers1

0

This sounds like a job for the DefinePlugin

Sidney
  • 4,495
  • 2
  • 18
  • 30