Upgrade to Thulite v2
This guide will help you migrate from Thulite v1 to Thulite v2.
Prerequisites
- Node.js -
v20.11.0or higher — runnode -vto check. - Hugo extended -
v0.125.0or higher — runhugo versionto check. - Text editor - We recommend VS Code — see also Editor Setup.
- Terminal - Thulite is accessed through its command-line interface (CLI).
Upgrading
You can upgrade your project by following the steps below.
1. Clean dependencies
Clean dependencies currently installed to avoid conflicts.
npm run clean:installpnpm run clean:installyarn run clean:install2. Update package.json
Replace the contents of your project’s package.json with the following:
{ "name": "thulite-project", "version": "0.0.0", "description": "Thulite", "author": "Thulite", "license": "MIT", "scripts": { "create": "hugo new", "dev": "hugo server --disableFastRender --noHTTPCache", "format": "prettier **/** -w -c", "build": "hugo --minify --gc", "preview": "vite preview --outDir public" }, "engines": { "node": ">=20.11.0" }}3. Install Thulite
Install the latest Thulite project dependencies inside your project:
npm install thulite@latestpnpm install thulite@latestyarn add thulite@latest4. Install Prettier and Vite
Install the latest version of Prettier and Vite — as devDependencies:
npm install -D prettier@latest vite@latestpnpm install -D prettier@latest vite@latestyarn add -D prettier@latest vite@latest5. Install integrations
Optionally, install the the recommended integrations in your project:
npm install @thulite/images@latest @thulite/seo@latestpnpm install @thulite/images@latest @thulite/seo@latestyarn add @thulite/images@latest @thulite/seo@latestConfiguration
Check your project’s configuration for Thulite and the recommended integrations:
Known Issues
ENOENT
When you get an ENOENT error message, run the following command:
npm run clean:install && npm installpnpm run clean:install && pnpm installyarn run clean:install && yarn install