Skip to content

baalspots/frontity-vercel-builder

Repository files navigation

Frontity Vercel Builder

Deploy your Frontity project to Vercel.

Before deploying

  1. Include the following settings in your projects vercel.json file:
{
  "builds": [
    {
      "src": "package.json",
      "use": "@baalspots/now"
    }
  ],
  "buildCommand": "node -v && npx frontity build && node -v",
  "devCommand": "npx frontity dev",
  "framework": null,
  "installCommand": "npm i",
  "outputDirectory": "build"
}
  1. Update your Frontity projects local dev environment to use Node 16.

  2. Update package.json at the root of your project to use the following Node engine and scripts:

"engines": {
 "node": "16.x"
},
"scripts": {
 "dev": "npx frontity dev",
 "build": "node -v && npx frontity build && node -v",
 "serve": "npx frontity serve"
},
  1. Remove all package-lock.json files and node-modules folders in your Frontity project.

  2. Remove package-lock.json from your projects .gitignore file

  3. Run npm i at the root of your project.

Hotfix for @loadable/component default export error

This is a temporary fix for the @loadable/component bug reported on Dec 19. Once this issue is resolved by the maintainers at @loadable/component, the following code snippets should be removed.

  1. Add the following dependency to your projects root package.json file:
"@loadable/component": "5.15.3",
  1. Add the following override settings to the end of your projects root package.json file:
"overrides": {
  "@loadable/component": "5.15.3"
}
  1. Remove all package-lock.json files and node-modules folders in your Frontity project.
  2. Run npm i at the root of your project.

Example package.json file

{
  "name": "frontity-project",
  "description": "Frontity project",
  "engines": {
    "node": "16.x"
  },
  "scripts": {
    "dev": "npx frontity dev",
    "build": "node -v && npx frontity build && node -v",
    "serve": "npx frontity serve"
  },
  "dependencies": {
    "@loadable/component": "5.15.3",
    ...
  },
  "devDependencies": {
    ...
  },
  "overrides": {
    "@loadable/component": "5.15.3"
  }
}