Paperclip can be modularized for re-usability across packages or NPM. To get started, make sure that you have a paperclip.config.json
file in the same directory as your
package.json file like so:
☝ It's important that
paperclip.config.jsonis in the same directory as
package.json, because this is how the Paperclip engine identify that this is a Paperclip module.
Going back to your project's
paperclip.config.json file, add a new
moduleDirectories property like so:
Next, assuming that
my-module is already installed in the
node_modules directory (via Yarn workspaces or Lerna), you can go ahead and
import your module files into your project.