npm install <path to this repo>
in your motion canvas projectnpm install <library name here>
This repo gives you a couple benefits over starting from scratch:
git remote add upstream https://github.com/hhenrichsen/motion-canvas-component-library-template
to gain the ability to update when this repo gets enhancements (via
git pull upstream main
)package.json
and run npm install
. I recommend
something like @username/library-name
.rollup.config.mjs
npm run watch
-- this will create some files in the lib
folder for
you, and rebuild them here when you make changes.src
folder, and make sure that it's
exported from the index.ts
file.npm install <path to this repo>
in a motion canvas project -- this will
add a link to this repo in your project.import {SwitchComponent} from '@username/library-name';
npm run build
one last time.npm install <path to this repo>
.npm publish --access public
. You may have to authenticate if this is
your first time publishing a package.