Skip to content

Redirect to index in webpack-dev-server if assetsPublicPath is set (close #915) #980

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

grakic
Copy link

@grakic grakic commented Oct 12, 2017

When assetsPublicPath is set, index.html and other files are server from this path
and not from the root. Starting webpack-dev-serve in this case is showing a blank
page on the root url. This change adds a redirection from the root url to
assetsPublicPath for convenience.

LinusBorg and others added 3 commits October 11, 2017 23:45
When assetsPublicPath is set, index.html and other files are server from this path
and not from the root. Starting webpack-dev-serve in this case is showing a blank
page on the root url. This change adds a redirection from the root url to
assetsPublicPath for convenience.
},
before: function(app) {
// Redirect to index.html in assetsPublicPath if path is not set to root
if (config.dev.assetsPublicPath && config.dev.assetsPublicPath != '/') {
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. I think !== is better, stylistically.
  2. Just thinking: Could this break anything for a relative path ('./')?

Copy link
Contributor

@LinusBorg LinusBorg Oct 16, 2017

Choose a reason for hiding this comment

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

this (comment above this one for the same line) has to be tested before merge.

@LinusBorg LinusBorg self-assigned this Oct 16, 2017
},
before: function(app) {
// Redirect to index.html in assetsPublicPath if path is not set to root
if (config.dev.assetsPublicPath && config.dev.assetsPublicPath != '/') {
Copy link
Contributor

@LinusBorg LinusBorg Oct 16, 2017

Choose a reason for hiding this comment

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

this (comment above this one for the same line) has to be tested before merge.

@LinusBorg LinusBorg changed the base branch from feature/webpack-dev-server(#964) to develop November 11, 2017 13:18
@LinusBorg LinusBorg removed their assignment Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants