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

Disable WDS contentBase option #282

Closed
wants to merge 1 commit into from
Closed

Conversation

jvasseur
Copy link
Member

We setup express static middleware ourselves so the content base option is not needed.

This will fix sending POST request to the API until the related bug is fixed in webpack-dev-server.

We setup express static middleware ourselves so the content base option is not needed.
@jvasseur jvasseur requested a review from amille44420 December 26, 2019 13:34
@@ -77,6 +77,7 @@ async function start() {

// webpack dev server (with HMR)
const devServer = new WebpackDevServer(clientCompiler, {
contentBase: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment here to explain why ? And link the issue which forced this change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is juste the trigger for the change, but the option should be disable even if the bug wasn't present.

Currently the whole project directory is served by the server (for example you can go to http://localhost:3000/package.json to get the package.json file).

Another solution would be to remove the static middleware in the before option and instead configure the contentBase option to serve the public directory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative would be #287

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative seems fine to me, the lesser behaviors we have to do ourselves, the better.

@jvasseur jvasseur closed this Jan 2, 2020
@jvasseur jvasseur deleted the disable-content-base branch January 2, 2020 15:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants