File-based inheritance

Concept

To keep hubble PWA updatable but also customizable it provides an inheritance mechanism only based on file paths. As a basis, hubble sets the nuxt srcDiropen in new window to /.hubble.

On every application build hubble PWA:

  1. creates a .hubble directory in the projects root directory if not already exists
hubble PWA File-based inheritance Concept Step 1
  1. takes all hubble core files from node_modules/@hubblecommerce/hubble/core and places them into .hubble
hubble PWA File-based inheritance Concept Step 2
  1. takes all nuxt related directories (except for: node_modules, .hubble, .nuxt, .idea) from the project root path and copy them into .hubble. Files that already exists will be overwritten.
hubble PWA File-based inheritance Concept Step 3

Overwriting files

To customize a specific component provided by hubble PWA you just have to:

  1. find the component or file you want to edit in node_modules/@hubblecommerce/hubble/core
  2. copy the file to your projects root directory, make sure the path stays the same
cp node_modules/@hubblecommerce/hubble/core/components/layout/TheLogo.vue components/layout/TheLogo.vue
  1. customize the file just created
  2. rebuild the application

.hubble Directory

Never customize files directly inside .hubble or the changes will be overwritten on next application build. There is no need for this directory to be versioned, so don't forget to add it to your .gitignore.

Path aliases

hubble PWA automatically sets the default aliasesopen in new window to the new nuxt root directory, so you can use them just as in a regular nuxt project.

Last Updated: