DEV Community

Chris Shaffer
Chris Shaffer

Posted on

Webpack Remote Development?

I didn't want my first post on Dev.to to be a question, but it seems to be the best place I've found to answer many other questions, so here goes.

I'm working on an app that requires I access an iframe; this means due to same-origin policy it would be awesome if I could do remote dev on the server providing the iframe so the origin is the same.

Right now, I'm running a build, uploading it to the test server, then messing with testing with the iframe in the browser console.

I'm wondering if anyone has had any success and can provide specific guidance on configuring Webpack to work with Nginx on a non-web root URL (i.e domain.com/testing).

I can get webpack to run, and I have a proxy_pass in Nginx successfully serving the page, however Webpack refuses to serve the app (Cannot GET /testing).

I've tried various configurations of the publicPath, public and contentBase settings, but Webpack simply can't figure out that I'm not at the web root. The console shows 404s for various scripts looking at / instead of /testing. None of this changes with the various devServer configs.

Any help would be greatly appreciated.

Top comments (0)