So you just build your app and pushes the "binary" output on Github Pages?
It would be better to push the output dir to another branch folder and force push it when you update.
Yeah, creating an orphan “gh-pages” branch is what I always do. Repositories that include build output in the main branch make me rather quite upset.
Your additional point about force pushing is a good one also. While I’ve been using separate branch I’ve still been commiting each new build as a new commit. But overwriting the initial commit makes a lot more sense actually.
This is what I do. Instead of committing /docs, I build into the root of the repo under the gh-pages branch. I use this package to help: https://www.npmjs.com/package/gh-pages
My example app is pretty contrived but I was mostly running into this issue when I had a multi-component app. An example is another repo I was working on: https://github.com/usmanity/prompt/tree/master/src
I guess, I should've prefaced my blog post with that :p
In a lot of cases you really don't want a server at that layer of the stack anyways, when you could be serving your site from a CDN/"edge" that's built for low-latency to end users, cost-optimized for transfer and not having to play all of the games that scaling yet another layer brings. I'm willing to believe that some people really need server side rendering but it'd a hard sell to convince me that the majority of people chasing SSR really need it, or that they're better off for it.
I'm currently batling with this and components inside components, not sure how to do it nor where to find info for it. if anyone as any guide would be very much appreciated.
Vue seems very similar to react[1]. Anyone know why vue is seeing a big swing in adoption when we already have react? Maybe because it's built into laravel[2]? Some other reason?
It is much more approachable, especially moreso than JSX. It combines the benefits of React but with single file components where HTML, JS, and CSS are all included in one file.
Any suggestions for running a Vue.js application as a local set of files, without running a web server? My use case is slightly more obscure than this, but imagine something like a local, off-network kiosk interface.
You can just open "index.html" in your browser and it will run fine, as longs as the paths inside your files are relative.
You might have to reconfigure your bundler. If you're using Parcel, just pass `--public-url .` as a command line option when building. For Webpack use the publicPath configuration, etc.
But remember that pages accessed via file:/// have limited permissions: you can't use localStorage, access some sites using CORS, can't capture audio/video, etc. But if you're not using these things then it's fine.
I guess this is an awful way to do it, but I heard stories about people that got away with a script that did and find and replace on build files to set some crazy paths.
I have been using Vue.js for a while and I'm really impressed by it. During development using `npm run serve` and having it automatically rebuild whenever a file is added or changes is great and then baking it out for static storage using `npm run build` is a great follow up.
None of this is specific to Vue. If you're using the Vue-CLI it's powered by Webpack which is the same build/development tool used by most major frameworks.
The main difference in my experience is the fact GitLab CI is very flexible. In this case, it would be trivial to use a node docker container and automatically build static assets on the server instead of doing it locally and polluting the repo.
https://github.com/justinwash/Client-Side-Vue