wiledal / gulp-include

Enables functionality similar to that of snockets / sprockets or other file insertion compilation tools.
157 stars 68 forks source link

Use includePaths as fallback when relative search fails #77

Closed yoozze closed 5 years ago

yoozze commented 7 years ago

If you set includePaths option, relative search is completely skipped and only provided paths are searched, when resolving includes.

This PR changes the way includes are resolved:

  1. try to resolve includes by relative search
  2. if relative search fails, try to resolve with includePaths if provided

This way you can use includes relative to current file and includes from predefined folders together without providing all possible file folders in includePaths.

KenEucker commented 5 years ago

:+1:

The question now is whether or not this is the expected behavior or if the intended behavior is to bail if the includePath is not found in a matched path. I'd love to see a test for the use case of this behavior and I think that will help sort out if it should be controlled via an optional param.

KenEucker commented 5 years ago

A solution to the original issue described here was resolved in #79.