Step 7: Publishing the Hook
If you plan on publishing your hook to npm, then you'll need to build it before doing so.
You can view the finished code for this step by checking out the
Build the Hook
Before you publish, you need to run
npm install inside the hook to build it. Doing this will cause the code will be transpiled and placed into two directories; raw ES5 code will be placed in a
lib/ directory, and ES5 code that leaves the import/export statements intact (a requirement for tree-shaking) will be placed in an
The final folder structure (after build) will look like this:
| |-- test.spec.js
That's all for this tutorial.
If you want to see a more full-featured version of this hook, check out the official lore-hook-polling hook.