Skip to content
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

mint build accidentally uses non relative path on Ubuntu. #11

Closed
Camto opened this issue May 28, 2018 · 4 comments
Closed

mint build accidentally uses non relative path on Ubuntu. #11

Camto opened this issue May 28, 2018 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@Camto
Copy link

Camto commented May 28, 2018

I used mint build and the generated HTML file doesn't work locally because it uses <script src="/index.js"></script> (correct: <script src="./index.js"></script>) which makes the computer think I want a file index.js from the top of the drive. I know mint start can work around that but it would be nice to be able to test out mint build locally.

@gdotdesign
Copy link
Member

It's a two fold thing:

  1. if deployed on a web server the URL needs to be absolute for the pages of an SPA to work. Usually every URL resolves the index.html which for an URL like this /users/:id would means that it needs to resolve the index.js from location that it reaches which is an absolute path.
  2. If you want to test it locally or build a Chrome or Electron application then you would need relative path, but in this case reloading a page that's on a deeper path would automatically fail.

I'm not against a configuration option or a command line flag for which controls whether the URLs are absolute or relative.

@gdotdesign gdotdesign added the enhancement New feature or request label May 28, 2018
@gdotdesign gdotdesign added this to the 0.2.0 milestone Jul 30, 2018
@brycefisher
Copy link

@gdotdesign I'd love to have the option to make all paths relative via configuration option! Is that still on the table?

@gdotdesign
Copy link
Member

It was implemented when this issue was closed: mint build --relative which makes all paths in the index.html relative.

@brycefisher
Copy link

Ah! Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants