helpscout / proxypack

🎭ProxyPack: Proxy Local Webpack Assets to your Production Domain
MIT License
6 stars 1 forks source link

Add overwrite public url #12

Closed tjbo closed 4 years ago

tjbo commented 4 years ago

Changed how Public Path was Modified in the Webpack Plugin

We were previously using a 3rd Party plugin for this functionality.

Webpack allows to automatically split and load code using require.ensure or dynamic import import(). Those modules are fetched on-demand when your main bundle is running in browser.

Webpack loads the modules (chunks) from a static URL, which is determined by config.output.publicPath of webpack configuration in the compiler.

In this case we are over writing this path to make sure that dynamic imports are resolved via ProxyPack's local node server.

This url is injected into the web browser, via the domain interceptor, but since web pack compiles this path we also need to make reference to it in source code (which is also better because we no longer need to inject it, we just write it into the bundled files).

Changed how WebPack compiler hooks are handled in ProxyPack Since we are adding additional hooks to the compiler process, also added a way to manage hooks if they are legacy < 4 or > 4.

Fixed Firefox not being able to be opened from CLI This was broken when we added a better way to manage SSL. The library we were using can't handle setting that pref.

We now manage FireFox independently by creating a custom profile and passing it when we want to open FireFox from the bin file. This will also make future updates to any FireFox functionality much easier to manage.

Added a way to set a Proxy in Safari ProxyPack was never working in Safari, as there is not a way to setup a Proxy when you open Safari, however there is a way to setup a WebProxy and a SecureWebProxy in MacOSx that Safari respects.