Assets and Raw Files

Assets are images, fonts, binary files and other files that do not need processing by Expansive and should be copied "raw" to the dist output directory. Expansive provides a means of listing the assets in your application to optimize the processing of these files. You can define you can define your assets in three ways:

Files Directory

The files directory contents are directly copied without processing to the dist directory during rendering. No Expansive pipeline processing takes place for these files. You can think of the files directory as a directory of "raw" files that are copied without modification.

Other Files Directories

The files directory is by default defined in the control.files list. You can add other directories to this list via the control.files property in the expansive.json configuration file. For example:

For example:

control: { files: [ 'files', '/usr/guest/myfiles' ] }

Copy Property

To designate files under the contents directory as assets, you can specify them in the control.copy property. This property takes an array of patterns for files that should be designated as being assets and thus bypass pipeline processing.

For example:

control: { copy: [ '**.tags', 'images' ], }

This will treat all *.tags files in any directory under contents, and all files under contents/images as assets. Note: the ** wild-card means to match in any directory.

You can also specify negated patterns to remove a file or pattern from the list. For example, to treat PHP files as assets and copy without processing, except for download.php.

control: { copy: [ '**.php', '!**download.php' ], }

© Embedthis Software. All rights reserved.