Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

PWADevServer file extension white list is problematic #32

Closed
DrewML opened this issue May 9, 2018 · 2 comments
Closed

PWADevServer file extension white list is problematic #32

DrewML opened this issue May 9, 2018 · 2 comments

Comments

@DrewML
Copy link
Contributor

DrewML commented May 9, 2018

passthru: ['js', 'map', 'css', 'json', 'svg']

We'll need to find a way to not have a whitelist of extensions. Consumers of this module will surely load other file types, and it won't be reasonable to require someone pass in all file extensions in the webpack config.

This is currently causing a 404 in this PR when loading a .jpg with file-loader.

@zetlen
Copy link
Contributor

zetlen commented May 9, 2018

@DrewML Agreed! I have an idea for what to do about it: instead of using patterns to blacklist, we should use a filter function that checks whether a filename is in the current set of assets Webpack emitted on the last run. This means hooking into the compiler, so we've gotta figure that out.

@DrewML
Copy link
Contributor Author

DrewML commented May 9, 2018

That shouldn't be too hard. Let's try and tackle it tomorrow to unblock @jimbo

zetlen added a commit that referenced this issue May 10, 2018
Modify PWADevServer to add the backend proxy in the `after()` block, not
the `before()` block. This allows `webpack-dev-middleware` to handle any
requests that it can handle, before the proxy can intercept them. This
is simple, doesn't require any filtering or regex matching, and does
exactly what the dev wants!

Fixes #32.
zetlen added a commit that referenced this issue May 10, 2018
Modify PWADevServer to add the backend proxy in the `after()` block, not
the `before()` block. This allows `webpack-dev-middleware` to handle any
requests that it can handle, before the proxy can intercept them. This
is simple, doesn't require any filtering or regex matching, and does
exactly what the dev wants!

Also, improve DevProxy tests, which were too implementation-bound.

Fixes #32.
zetlen added a commit that referenced this issue May 11, 2018
* fix(DevProxy): put proxy after other middlewares

Modify PWADevServer to add the backend proxy in the `after()` block, not
the `before()` block. This allows `webpack-dev-middleware` to handle any
requests that it can handle, before the proxy can intercept them. This
is simple, doesn't require any filtering or regex matching, and does
exactly what the dev wants!

Also, improve DevProxy tests, which were too implementation-bound.

Fixes #32.

* chore(doc): explanatory comment on DevProxy in test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants