DEV Community

Chris Shaffer
Chris Shaffer

Posted on

3

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.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay