vite-ssg | Static site generation for Vue 3 on Vite | Plugin library

 by   antfu TypeScript Version: 0.23.7 License: MIT

kandi X-RAY | vite-ssg Summary

kandi X-RAY | vite-ssg Summary

vite-ssg is a TypeScript library typically used in Plugin, Vue applications. vite-ssg has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Static-site generation for Vue 3 on Vite. ℹ️ Vite 2 is supported from v0.2.x, Vite 1's support is discontinued.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              vite-ssg has a medium active ecosystem.
              It has 1026 star(s) with 119 fork(s). There are 12 watchers for this library.
              There were 2 major release(s) in the last 12 months.
              There are 74 open issues and 158 have been closed. On average issues are closed in 52 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of vite-ssg is 0.23.7

            kandi-Quality Quality

              vite-ssg has 0 bugs and 0 code smells.

            kandi-Security Security

              vite-ssg has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              vite-ssg code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              vite-ssg is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              vite-ssg releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vite-ssg
            Get all kandi verified functions for this library.

            vite-ssg Key Features

            No Key Features are available at this moment for vite-ssg.

            vite-ssg Examples and Code Snippets

            No Code Snippets are available at this moment for vite-ssg.

            Community Discussions

            QUESTION

            Vercel + Vite - 404 not found
            Asked 2021-Dec-07 at 11:02

            I am developping a website with vite which seem work like it should on localhost.
            I deployed on Vercel and the site was build without errors.
            But I discovered a big problem when I wanted to generate my sourcemaps. In fact, when I want to visit any page directly (.../about for example) vercel sends me a "404 not found" error. But when I go to the root page and navigate to the page manually everything is working. Second time i visit the /about page directly, it works, but because it has been cached by my browser i think ...

            hosting : vercel
            base url: https://dev.energie-etre-ange.fr
            404 example url : https://dev.energie-etre-ange.fr/about

            used plugins :

            • vite-plugin-pages
            • vue-router (v4)
            • vite-ssg

            I can give the github link if needed, but i think this is mostly a vercel problem ? I found a linked problem on stackoverflow, but with React (link)

            ...

            ANSWER

            Answered 2021-Dec-07 at 11:02

            Answer found here : https://stackoverflow.com/a/66686684/13541914
            Credit goes to shantiscrip

            Solution:
            This is not a problem with vite.js but due to with a missing configuration file for vercel which is added by default to the existing templates. For a single page application the html files for the routes created with react router don't exist, so something on the server needs to create rewrites to make sure every request points at '/' or index.html. In Vercel this can be done by adding a rewrite to config file in the root of the project called

            vercel.json
            https://vercel.com/docs/configuration
            Add rewrites for all routes to the file that point to '/'

            Source https://stackoverflow.com/questions/70249976

            QUESTION

            Create api calls in Vite (with ViteSSR / ViteSSG)
            Asked 2021-Nov-30 at 10:48

            I'm currently developping a simple eCommerce site with ViteJS.
            My Project uses :

            • Vue 3
            • Vite 2.4
            • vite-plugin-pages, for automatic route generation (Nuxt Style)
            • vite-ssg, for server side generation (SEO optimisation)

            Hosting is done on free netlify account (I am open to switch to vercel or other if needed). The Data handling is done via Headless CMS GraphCMS, hosted on their servers.

            Following a tutorial on Stipe integration with NextJS & GraphCMS i came across a problem. In NextJs you can natively create server-side api routes, unlike in Vite.
            As ViteSSG (Server Side Generated) has the ability of pre-rendering the shipped html, and running code on server-side, I would like to understand how I could create a server route to serve an api without having to go though the hassle of creating and hosting a seperate backend only for a simple call :

            POST https://localhost:3000/api/create-checkout-session

            Because if i create the stripe checkout session on the client side (inside payBtn click handler), the data (price, etc ...) could be altered by the client as the handler code would be served client-side. I want this session to be generated on server side and its Id sent back to client to be then used in the checkout process. It would remove the ability to alter the data.

            I can share more code if needed, and expand information if something is not clear enough. Thanks for the help !

            ...

            ANSWER

            Answered 2021-Nov-30 at 10:48

            In NextJs you can natively create server-side api routes

            Yes because it has a server component running on Node (so you need a Node server to run the Next/Nuxt site ....unless using "generate" mode)

            As ViteSSG (Server Side Generated) has the ability of pre-rendering the shipped html

            Yes, during build time

            and running code on server-side

            I don't know why you think this but I really really doubt it. vite-ssg runs only at build time. It has no server component that is either required or even available at runtime (when serving your pre-rendered pages)

            Vite itself is development tool only. Again, the "server" component of Vite is there ONLY to serve resources during development. There are some plugins which allows you to streamline creation of server side routes as vite-plugin-mix or fastify-vite but both just generates a server-side code bundle for you and you need to setup the Node server to actually run the API

            But you really need some server functionality - Stripe documentation is pretty clear in that regard. But you do not need a standalone server (which needs setup and runs 24/7). What you can try is called "serverless computing". Most hosting providers have something like that including Netlify - Netlify functions

            I have no direct experience with it but if you google a bit you can find an examples on how to integrate it with Vite (using proxy)

            Source https://stackoverflow.com/questions/70162479

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install vite-ssg

            This library requires Node.js version >= 14.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i vite-ssg

          • CLONE
          • HTTPS

            https://github.com/antfu/vite-ssg.git

          • CLI

            gh repo clone antfu/vite-ssg

          • sshUrl

            git@github.com:antfu/vite-ssg.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link