-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
serveIndex is now serving wrong directory if having multiple paths in contentBasePublicPath #2645
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
Comments
Actually, I have read the Pull Request: #2489 (Modified In this PR, contentBasePublicPath accepts multiple paths. It actually does, I can access the following links (status code 200):
However, in the following snippet, // ...
setupServeIndexFeature() {
// ...
if (Array.isArray(contentBase)) {
contentBase.forEach((item) => {
this.app.use(contentBasePublicPath, (req, res, next) => {
// serve-index doesn't fallthrough non-get/head request to next middleware
if (req.method !== 'GET' && req.method !== 'HEAD') {
return next();
}
serveIndex(item, { icons: true })(req, res, next);
});
});
}
// ...
}
// ... If |
Other problemI am not sure if I should create a new issue or not, but anyway, let me write them down first. Should cover all possibilities of combining options togetherI tried to list a table by only checking the code. (Sorry, I don't have extra time to test them now.)
|
contentBase | contentBasePublicPath | Current Behavior |
---|---|---|
boolean: false | string / [string] | working, not pushed into runnableFeatures |
number | string / [string] | working, showing deprecated |
string | string | working |
string | [string] | not working and not implemented |
[string] | string | working |
[string] | [string] | working |
setupServeIndexFeature
contentBase | contentBasePublicPath | Current Behavior |
---|---|---|
boolean: false | string / [string] | working, not pushed into runnableFeatures |
number | string / [string] | working, doing nothing |
string | string | working |
string | [string] | not working and not implemented |
[string] | string | working |
[string] | [string] | not working and not implemented |
setupWatchStaticFeature
contentBase | watchContentBase | Current Behavior |
---|---|---|
any | false | working, not pushed into runnableFeatures |
boolean: false | true | potential problem running chokidar.watch(false, watchOptions) |
number | true | working, throwing error |
string | true | working |
[string] | true | working |
Should remove duplicate features in runnableFeatures
In setupFeatures, there is possibility to produce duplicated elements in runnableFeatures
. It might be a potential problem.
WIP for v4, no fixed for v3, sorry |
Yes, no ETA, maybe end of the month |
@LuckyWindsck Can you try |
Fixed in |
Sorry for late reply. $ git diff issue-opened:webpack.config.js issue-resolved:webpack.config.js |
NPM Version: 6.14.4(I usedyarn
)Code
Repository link if needed.
Expected Behavior
When running
webpack-dev-server
, three pages should be opened.They should be the following links respectively:
Also, since
devServer.serveIndex
istrue
by default, these pages should list the directory structure of./static1
,./static2
,./static3
with the same structure as the actual directory .Actual Behavior
For Bugs; How can we reproduce the behavior?
Just run
webpeck-dev-server
(version 3.11.0), and one should be able to reproduce this behavior.For Features; What is the motivation and/or use-case for the feature?The text was updated successfully, but these errors were encountered: