-
-
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
chore: upgrade dev middleware #2660
Merged
alexander-akait
merged 26 commits into
webpack:v4
from
knagaitsev:chore/upgrade-dev-middleware
Jul 2, 2020
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f192a40
chore(server): upgrade dev middleware and change options
knagaitsev cab2924
test(server): change noop invalidate test
knagaitsev 78ebd08
chore(middleware): change how mime types work and use of middleware api
knagaitsev 390da6c
chore(middleware): fix routes functionality with middleware
knagaitsev 8aca25b
test(options): update create config test for public path
knagaitsev 7489d41
test(options): update headers test
knagaitsev 1d2dad9
refactor(server): remove stats option and use compiler stats option
knagaitsev bef4800
test(options): update options test and remove one error message
knagaitsev 717bec4
test(server): update normalizeOptions test
knagaitsev b462d2d
test(server): update createConfig test
knagaitsev 4d26b5d
test(server): update validation test and change tested option
knagaitsev 6c927c7
test(server): update multi compiler test
knagaitsev 22d97d5
test(cli): remove color cli test
knagaitsev 99e31d9
chore(deps): remove supports color
knagaitsev 3c0f598
test(server): update universal compiler test
knagaitsev 948a4bc
chore(server): add headers option back and update tests
knagaitsev 3f0f0b8
test(server): change title of header test
knagaitsev 86f6b2a
test(server): update tests for headers option
knagaitsev 121d999
chore(server): change devMiddleware name to dev
knagaitsev db4903e
chore(deps): upgrade webpack dev middleware for patch release
knagaitsev c8aec00
test(e2e): add delay between writing of css files and compilation
knagaitsev b657eb1
test(server): fix stats tests for webpack 5
knagaitsev 157a26a
test(server): fix stats option test for webpack5
knagaitsev 80a34c1
test(server): fix stats test value
knagaitsev 3319b0b
fix(server): ignore stats objects that are empty
knagaitsev 30b3443
test(server): fix test stability by adding unique port mappings
knagaitsev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,16 +47,18 @@ function createConfig(config, argv, { port }) { | |
options.overlay = argv.overlay; | ||
} | ||
|
||
if (!options.publicPath) { | ||
options.devMiddleware = options.devMiddleware || {}; | ||
|
||
if (!options.devMiddleware.publicPath) { | ||
// eslint-disable-next-line | ||
options.publicPath = | ||
options.devMiddleware.publicPath = | ||
(firstWpOpt.output && firstWpOpt.output.publicPath) || ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is really bad idea smile But let's resolve it on the other PR |
||
|
||
if ( | ||
!isAbsoluteUrl(String(options.publicPath)) && | ||
options.publicPath[0] !== '/' | ||
!isAbsoluteUrl(String(options.devMiddleware.publicPath)) && | ||
options.devMiddleware.publicPath[0] !== '/' | ||
) { | ||
options.publicPath = `/${options.publicPath}`; | ||
options.devMiddleware.publicPath = `/${options.devMiddleware.publicPath}`; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It is good place to do discussion, should we move all webpack-dev-middleware in the one place
/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.
I think it makes sense because webpack-dev-middleware now does options validation that only allows for the properties specified. So we can just validate
devMiddleware
as an object, and if the user passes in bad webpack-dev-middleware options then webpack-dev-middleware validation will throw an error.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.
I prefer this idea.
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.
Let's rename it to
dev
, I think it is unnecessary to havemiddleware
suffix, we don't have it for other middlewaresThere 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.
Also, it will be better for CLI -
webpack server --dev-something=value