0.5.1 • Published 9 months ago

vercel-quasar v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

vercel-quasar

Vercel builder for Quasar with SSR enabled

Help you to deploy Quasar application on Vercel in SSR mode

usage

1. change the listen function in your src-ssr/server.js file

  • return { handler: ssrHandler }
/**
 * The "listenResult" param for the "close()" definition below
 * is what you return here.
 *
 * For production, you can instead export your
 * handler for serverless use or whatever else fits your needs.
 */
export async function listen({ app, port, isReady, ssrHandler }) {
  if (process.env.DEV) {
    await isReady();
    return await app.listen(port, () => {
      if (process.env.PROD) {
        console.log('Server listening at port ' + port);
      }
    });
  } else {
    // in production
    // "ssrHandler" is a prebuilt handler which already
    // waits for all the middlewares to run before serving clients

    // whatever you return here is equivalent to module.exports.<key> = <value>
    return { handler: ssrHandler };
  }
}

2. Configure vercel-quasar as builder in vercel.json

Add a vercel.json file to your project root path

{
  "version": 2,
  "builds": [
    {
      "src": "package.json",
      "use": "vercel-quasar"
    }
  ]
}

3. Custom build command

The default build command is npx quasar build -m ssr,if you want to use custom it,add a build:ssr or build script to your package.json

Note that the priority of build:ssr is higher than that of build. If build:ssr exists, command build will not be executed in deploy.

  • example

{
  "name": "quasar-example",
  "version": "1.0.0",
  "productName": "quasar-example",
  "scripts": {
    "dev": "quasar dev",
    "dev:ssr": "quasar dev -m ssr",
    "build:ssr": "node build/index.js && quasar build -m ssr"
  },
  "dependencies": {},
  "devDependencies": {}
}
0.4.9

9 months ago

0.4.8

9 months ago

0.5.1-beat.3

9 months ago

0.5.1-beat.4

9 months ago

0.5.1-beat.1

9 months ago

0.5.1-beat.2

9 months ago

0.5.1-beat.0

9 months ago

0.5.0

9 months ago

0.5.1-beat.5

9 months ago

0.5.1

9 months ago

0.5.1-beat.6

9 months ago

0.4.10

9 months ago

0.4.17

9 months ago

0.4.15

9 months ago

0.4.16

9 months ago

0.4.13

9 months ago

0.4.14

9 months ago

0.4.11

9 months ago

0.4.12

9 months ago

0.4.5

9 months ago

0.4.4

9 months ago

0.4.7

9 months ago

0.4.6

9 months ago

0.4.1

9 months ago

0.4.3

9 months ago

0.4.2

9 months ago

0.1.10

2 years ago

0.0.20

2 years ago

0.1.11

2 years ago

0.0.21

2 years ago

0.1.12

2 years ago

0.0.22

2 years ago

0.1.13

2 years ago

0.3.1-beat.0

2 years ago

0.3.1-beat.2

2 years ago

0.3.1-beat.1

2 years ago

0.3.1-beat.4

2 years ago

0.3.1-beat.3

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.10

2 years ago

0.2.1-beat.0

2 years ago

0.0.11

2 years ago

0.2.1-beat.1

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.1.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.8

2 years ago

0.0.9

2 years ago

0.1.7

2 years ago

0.0.8

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.0.7

2 years ago

0.1.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.1

2 years ago