-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass mimeTypes option to webpack-dev-middleware #1714
Conversation
`webpack-dev-middleware` exposes an option to set custom mime types via passing a mimeType object, see https://github.com/webpack/webpack-dev-middleware#mimetypes This commit allows the user to set `devServer.mimeType` in `webpack.config.js` to pass custom mimes types to `webpack-dev-middleware`
a4203c9
to
f811ae3
Compare
Codecov Report
@@ Coverage Diff @@
## master #1714 +/- ##
=========================================
Coverage ? 83.76%
=========================================
Files ? 8
Lines ? 536
Branches ? 161
=========================================
Hits ? 449
Misses ? 70
Partials ? 17 Continue to review full report at Codecov.
|
f811ae3
to
c780289
Compare
We create new issue in |
@evilebottnawi this PR can be reviewed. I updated the description to mirror the changes from the latest commits. One question: In the test, I need to request |
Good question, we need check what is file created after run build Anyway code looks good, let's investigate about |
It seems the default naming (when no output.filename is given) is not really documented anywhere. But this comment webpack/webpack#6543 (comment) suggests that the output filename will simply be the chunk name. While the chunk name again will be
|
@dmohns yep, let's look what file exists in output path for our test config (it should be simple) |
I am a little lost on this one. From the code, it simply looks like
|
/cc @hiroppy can you see in test and help, don't have time right now |
@dmohns also please rebase on master |
/cc @hiroppy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
@dmohns Could you submit a pr about this to https://github.com/webpack/webpack.js.org? |
For Bugs and Features; did you add new tests?
Yes, tests for
createConfig
, a basic sanity check and test for changed mime type.Motivation / Use-Case
webpack-dev-middleware
exposes an option to set custom mime types viapassing a mimeType object, see
https://github.com/webpack/webpack-dev-middleware#mimetypes
This commit allows the user to set
devServer.mimeType
inwebpack.config.js
to pass custom mimes types towebpack-dev-middleware
Closes #1700
Breaking Changes
No.
Additional Info
As part of this change the documentation at https://webpack.js.org/guides/development/ needs to be updated as well. I couldn't yet figure out how this is done. And, whether or not the documentation has to be updated at the time (or can be updated later, once this PR is merged).
ToDo