webpack should support publicPath with different port for testing on mobile devices

It’s hard to integrate webpack-dev-server with an existing server like Meteor and then load the page on a mobile device connected to my dev machine via LAN.

The problem is that while publicPath: "http://localhost:8080/" (or publicPath: "http://0.0.0.0:8080") works for testing the page on my dev box, they don’t work for testing the page on a mobile device.

If Webpack simply supported config like this it would solve the problem:

output: {
  publicPath: "/",
  publicPort: 8080,
}

Meaning that if I load a resource doge.png with url-loader, the bundle will request it from <page base URL>:8080/doge.png and will load properly on a mobile device.

Author: Fantashit

1 thought on “webpack should support publicPath with different port for testing on mobile devices

Comments are closed.