How to add snowpack gh pages? #1423
-
I do not think the repo name part of the url (gh-pages-svelte) is being processed correctly. I did
Then I updated snowpack.config.js to put the output in the docs folder as github expects
Then I did the expected github commit. The url to the site is https://markfirmware.github.io/gh-pages-svelte/ |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 23 replies
-
Hi @markfirmware hmm interesting question, I haven't tried deploying to GH pages yet but I'm going to put that on my todo list. In the meantime let us know if you figured out the solution. |
Beta Was this translation helpful? Give feedback.
-
+1! If this is not supported on our end, it should be! |
Beta Was this translation helpful? Give feedback.
-
So the solution here is:
Here is the working fork of your original repo:https://github.com/stramel/gh-pages-svelte (https://stramel.github.io/gh-pages-svelte/) Also, note, you will need to change the |
Beta Was this translation helpful? Give feedback.
-
@stramel Thanks so much! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Was anybody able to pull this off? |
Beta Was this translation helpful? Give feedback.
-
I made a Repl.it template that showcase how to develop and deploy Snowpack projects on Github page, all directly from Repl.it. See https://repl.it/@jgrizou/Snowpack-Boilerplate Read https://github.com/jgrizou/snowpack-boilerplate/blob/master/Readme.md to see how to deploy directly via Repl.it Associated repository is https://github.com/jgrizou/snowpack-boilerplate which deploys at https://jgrizou.github.io/snowpack-boilerplate/ |
Beta Was this translation helpful? Give feedback.
-
My issue is that I need to change the output directory from I ended up doing this in package.json:
(Note: it requires npm installing the copyfiles npm package) This just copies everything in the "build" directory into the "docs" directory after Snowpack has finished building the site assets. It's hacky but it does the job. Does anyone know how to get Create Snowpack App to output directly into a "docs" folder instead of a build folder? You still need to do the things mentioned in this comment as well to get it fully working: #1423 (comment) |
Beta Was this translation helpful? Give feedback.
@markfirmware
So the solution here is:
snowpack.config.js
withbuildOptions.baseUrl: '/gh-pages-svelte'
public/index.html
to be prefixed with%PUBLIC_URL%
(ie.%PUBLIC_URL%_dist_/index.js
). Alternatively, you can utilize<base href="%PUBLIC_URL%" />
and remove the leading/
on all file references..nojekyll
file to thedocs
folder. (This disables Jekyll which ignores all folders with leading_
)Here is the working fork of your original repo:https://github.com/stramel/gh-pages-svelte (https://stramel.github.io/gh-pages-svelte/)
Also, note, you will need to change the
/logo.svg
path. https://www.snowpack.dev/#import-images-%26-other-assets