Copy is a utility API that helps copy static assets from src directories into a distribution directory. This can be useful for when developing component libraries that depend on static components throughout the development life cycle.
|Yes||N/A||Source path directory to copy from|
|No||Destination path to copy to|
|No||Matching pattern for source files|
There are three arguments available for copy files. All paths and patterns are relative to where the command is invoked.
While source is a required field both dest and the given pattern are not. Source generally is a path but can also be one of a few keywords.
More information about these
<source> keywords can be found in our Shortcuts section below.
<source> is not one of the args from above,
copy will attempt to copy all contents of the source path/file to the provided dest path/file.
Optionally we can provide a pattern to match specific file types against when copying between two locations.
A common pattern where this might be used is as a post command hook after a compilation step has completed.
Note: The shortcuts listed below are based on our own opinions for directory structure. They are provided as a convenience. |Argument|Description| |---|---| |
.icofiles | |
.scssfiles | |
.svgfiles | |
assets| Functions as an alias for combing all of the above cmds. |
All files in all subdirectories relative to where the command is run that have the file extension matching that of the above keywords will be copied to a default
./disb/lib directory. If the source provided is of an existing directory or file path,
copy will attempt to copy all contents of the provided source path to a default
The general pattern for these shortcuts follows the below pattern.
A more specific example for copying scss into our distribution directory might look like the following.
As with the more general version a common pattern is to use this as a post command hook.