This is a boilerplate for Hubspot themes using Vue 3 and vue/cli. It is based on the cms vue boilerplate
npm install -g @hubspot/cli
- Create hubspot config file to be able to upload your theme to hubspot
hs init
- Change default portal variable in vue.config.js
const defaultPortal = 'dev' <-- change this to the name of your portal in hubspot.config.yml
- Change the destination folder to match your theme folder in hubspot
const destination = 'hubspot-vue-boilerplate';
- Install dependencies
npm install
- Build and upload to hubspot
- Used to build and upload once
npm run build
- Used to build and upload when changes occur
npm run watch
- Used to build and upload once
When creating a new module you need to do a couple of things.
- Duplicate the text.module folder and change the folder- and filenames to match the correct module
- Also change the label in mete.json
- Remove all fields in fields.json escept the module_name. Set the default value of the module_name to the module name. This is used when rendering the module.
- Go into App.vue and add the module to the modules array by setting the key to the module name (same as module_name field) and module to the imported module.
- Make any changes you want to the modules .vue file.
If you have any suggestions or improvements please feel free to reach out or create a pull request
- Hubspot local development: https://developers.hubspot.com/docs/cms/guides/getting-started-with-local-development
- Hubspot and javascript frameworks: https://developers.hubspot.com/docs/cms/guides/js-frameworks