gulp-file-include
gulp-file-include copied to clipboard
Include file with data where a key value is a variable passed from gulp
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.
Hi @yairEO. Can you found how to do this?
@SilvaLA59 - While I did not do that personally, you could use gulp-replace to replace specific strings in the stream with any other string.