gulp-file-include icon indicating copy to clipboard operation
gulp-file-include copied to clipboard

Include file with data where a key value is a variable passed from gulp

Open yairEO opened this issue 8 years ago • 2 comments

main.html (src file)

<!DOCTYPE html>
<html lang='en'>
    <head>
        @@include('../html-includes/head.html', { "pageName":"foo", "pageCSSFile":"bar", "serverPath":xxx })
    </head>

I want xxx to be a variable passed from gulp to my main file (main.html). it has many includes which use that serverPath property in the data passed and I want it to come from gulp.

I can't seem to find how to do that since context only allows the things to be used in if statements. which is a bummer.

yairEO avatar Feb 12 '17 15:02 yairEO

Hi @yairEO. Can you found how to do this?

SilvaLA59 avatar Nov 07 '17 14:11 SilvaLA59

@SilvaLA59 - While I did not do that personally, you could use gulp-replace to replace specific strings in the stream with any other string.

yairEO avatar Nov 07 '17 16:11 yairEO