-
Notifications
You must be signed in to change notification settings - Fork 448
Watching for Changes and Auto Regenerating Patterns
The PHP version of Pattern Lab has the ability to watch for changes to patterns and select files. When these files change, it will automatically rebuild the entire Pattern Lab website. You simply make your changes, save the file, and the PHP version of Pattern Lab will take care of the rest.
To set-up the watch on Mac OS X you can do the following:
- Open
scripts/
- Double-click
startAutoRegenerate.command
You can also start the watch from the command line. To do so open Terminal and navigate to the root of the patternlab-php
directory. Type:
php builder/builder.php -w
To stop watching files on Mac OS X you can pressCTRL+C
in the Terminal window where the process is running.
By default, the PHP version of Pattern Lab monitors the following files:
- all of the patterns under
source/patterns
source/data/data.json
source/data/listitems.json
source/css/styles.css
You can add additional files to be watched by editing config/config.ini
. For example, you might want to track separate CSS files. In config/config.ini
you will want to add the source files to wf
and the location where the source files should be moved to to mf
. Make sure to separate file names with a comma.
For example, let's say we wanted to watch a new CSS file, generated by Sass, that was at source/css/blueberry.css
. When it was generated/saved we want the file moved to public/css/orange.css
. To do this we'd modify our config/config.ini
like so:
wf = "css/style.css,css/blueberry.css"
mf = "css/style.css,css/orange.css"
When blueberry.css
was saved the PHP version of Pattern Lab would move it to public/css/orange.css
.