-
Notifications
You must be signed in to change notification settings - Fork 68
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
Utilize baseURL to allow for easy local development and alternative gh-pages #179
Comments
@Fedelaus It is considered to be a good enhancement. |
Thanks for the response. I will test if these changes have the desired effects and submit a further pull request. |
@Fedelaus publicPath was set in a way that See if your commits find the solution Thanks |
@abhijithvijayan by setting I will update you. |
@Fedelaus okay. |
@Fedelaus May be we can use an environment file to set the base_url so that we can use travis to set the variable in the production. I never thought this was a big deal but now may be I can also have a look at the config file so as to fix the issue with the path in the production and the development environment. |
@ashikmeerankutty that is what I was thinking. The current proposed changes are:
I have yet to attempt this and is just theorized currently. |
@Fedelaus I found an alternative solution for this rather than messing up with the webpack config. All these issues are caused because of the link in the production In your approach of adding a public path in the HTMLWebpackPlugin and specifying it requires a lot of manual work as we need to change all the html files to add a public path to the urls with lodash. Rather than going for that we can actually do the whole thing using javascript so that if the document.onclick = function (e) {
e = e || window.event;
var element = e.target || e.srcElement;
if (element.tagName == 'A') {
window.location.assign("http://ceadoor.github.io/cea.ac.in/"+element.getAttribute("href"))
return false;
}
}; |
Currently there exists an issue where certain resources are required in from static locations or links to pages only work in certain environments.
Currently I notice HTMLWebpackPlugin's
publicPath
is being used, it would be best to usebaseURL
as this would accomodate the issue which github pages poses to relative links.This change would require the removal of the
html-loader
, but I believe this is currently not in use anyway.This would allow setting baseURL based on
options.mode
in the webpack config. In localhost, this can be set tolocalhost:8080
and all relative links will point towards that, whereas github pages would allow forhttps://ceadoor.github.io/cea.ac.in/
and this would allow us to drop links such as/cea.ac.in/about
to/about
.The text was updated successfully, but these errors were encountered: