Prerequisites
Before you begin, ensure you have:- Node.js (v16 or higher)
- npm (v7 or higher)
- HubSpot CLI installed and configured
- A HubSpot account with CMS Hub access
Installation
Clone the repository and install dependencies:Development Workflow
Start Development Mode
Run all watch tasks in parallel:- Tailwind CSS - Watches and compiles CSS changes
- JavaScript - Bundles JavaScript with esbuild
- HubSpot - Uploads changes to HubSpot CMS
Individual Watch Commands
You can also run watchers individually:NPM Scripts
The theme includes several useful npm scripts:Build Commands
HubSpot Commands
Version Management
Maintenance
File Structure
The development workflow follows this structure:Development Tips
Hot Reload
When runningnpm start, changes are automatically:
- Compiled/bundled locally
- Uploaded to HubSpot CMS
- Reflected in your preview environment
Working with CSS
Edit files insource/css/ - they will be compiled to theme/css/tailwind.css:
- Base styles:
source/css/base/ - Components:
source/css/components/ - Utilities:
source/css/utilities/
Working with JavaScript
Editsource/js/main.js or create new modules in source/js/modules/. The bundler will automatically include dependencies.
Linting and Formatting
The project uses Husky for Git hooks to ensure code quality before commits.Troubleshooting
Watch Commands Not Working
If file watching stops working:- Stop all processes (Ctrl+C)
- Run
npm run clean - Restart with
npm start
HubSpot Upload Issues
If uploads fail:- Check your HubSpot CLI configuration:
hs auth - Verify the destination path in
package.json - Ensure you have proper permissions in HubSpot
Build Errors
For build errors:- Delete
node_modulesand runnpm install - Check for syntax errors in source files
- Review error messages in the terminal