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

Choosing output path for build #79

Open
roddds opened this issue Jan 21, 2020 · 3 comments
Open

Choosing output path for build #79

roddds opened this issue Jan 21, 2020 · 3 comments

Comments

@roddds
Copy link

roddds commented Jan 21, 2020

Right now, by running yarn build a static version of the presentation is generated in the /public directory, but I can't seem to figure out a way to change the relative path for static files. For example, if I'm uploading to a /presentation directory on my server, all static files 404 because index.html and other files have paths relative to the root.

In create-react-app this is solved by changing the path in the configuration file, but I can't seem to find how to do that with code-surfer.

@roddds
Copy link
Author

roddds commented Jan 21, 2020

Upon further research, I realized Code Surfer is built on mdx-deck, which is built on gatsby, and according to gatsbyjs/gatsby#1878 this will probably never be possible.

Damn.

@roddds roddds closed this as completed Jan 21, 2020
@roddds
Copy link
Author

roddds commented Jan 22, 2020

So it turns out I was barking at the wrong tree here - that gatsby issue is related to renaming the public directory itself, not any subdirectories. I also found this help page. So now the only step left was to figure out how to change mdx-deck's gatsby settings. As far as I could tell there was no way to do it directly, but as a workaround you could:

  • Change the ./node_modules/mdx-deck/gatsby-config.js and include the pathPrefix setting.
  • Change this in ./node_modules/.bin/mdx-deck from gatsby('build') to gatsby('build', '--prefix-paths').
  • Run your build

As far as workarounds go this is a pretty terrible one, but since I won't be running builds that often, this is acceptable to me.

Would love to hear from other people that had similar problems.

@roddds roddds reopened this Jan 22, 2020
@pomber
Copy link
Owner

pomber commented Feb 13, 2020

Hi @roddds, I haven't tried changing the output path. But the build command is from mdx-deck not code-surfer. Maybe you should create the issue there.

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

No branches or pull requests

2 participants