Skip to content
This repository has been archived by the owner on Sep 15, 2019. It is now read-only.

buildInject

tones31 edited this page Oct 17, 2016 · 1 revision

Injects a file as a UTF8 string into an HTML file, placed in between a start and end injection tag. This is most useful for injecting HTML into HTML, or script and stylesheet paths into HTML.

Example

This will take the file header.html and inject it into template.html in between the tags <!--inject:header--> and <!--endinject-->. Finally it will rename the file to index.html and save it to the file path as defined in build.myApp.

var templateFile = src.assets.html + 'template.html';
var headerFile = src.assets.html + 'header.html';
return buildInject(templateFile, headerFile, `header`, build.myApp, 'index.html');
Clone this wiki locally