Custom Patterns - Patternslib/project-scaffold GitHub Wiki
Patterns wants to make it easy to program new interaction patterns and add them to your project. It allows you to use the bundling mechanism and to use the Patterns properties parser if you want to use that.
Here's how you create a new Pattern.
Step 1. Create your Pattern file
Each custom Pattern should go into its own folder inside '/src/patterns/name-of-your-custom-pattern'.
Consult the Patterns documentation for how to program a Pattern or how to turn an existing Jquery plugin into a Pattern.
Step 2. Register and call your Pattern
- Open the file '/main.js' in your editor. Create a new line under
paths
, under// Project Patterns
that contains the name and path to your Pattern. - Open the file '/bundle-config.js' in your editor. Create a new line under
define([
with the name of your Pattern. This will make sure that your script is included in the bundle.
Step 3. Make bundle
Run the make bundle
command in your project folder to create a new bundle that includes your new Pattern.