1.0.19 • Published 10 months ago
gulp-build-html v1.0.19

Used to process html files to automatically concat css and js files, and meanwhile update html references.
Usage
This plugin works similarly as gulp-useref but supports inline scripts.
Style1
<!-- build:css ../css/index.html.allinone.css -->
<link rel = "stylesheet" href = "../css/view1/a.css"/>
<link rel = "stylesheet" href = "../css/view1/b.css"/>
<!-- endbuild --><!-- build:js index.html.allinone.js -->
<script type = "text/javascript" src = "../js/view1/a.js"></script>
<script type = "text/javascript" src = "../js/view1/b.js"></script>
<script type = "text/javascript">
alert("hello, world")
</script>
<script type = "text/javascript" src = "../js/view2/c.js"></script>
<!-- endbuild -->Style2
<slot for="merge-reference-content"
fileType="css"
outputLocation="file"
outputFilePath="../css/${fileBaseName}.allinone.css"
>
<link rel = "stylesheet" href = "../css/view1/a.css"/>
<link rel = "stylesheet" href = "../css/view1/b.css"/>
</slot><slot for="merge-reference-content"
fileType="js"
outputLocation="inline"
>
<script type = "text/javascript" src = "../js/view1/a.js"></script>
<script type = "text/javascript" src = "../js/view1/b.js"></script>
<script type = "text/javascript">
alert("hello, world")
</script>
<script type = "text/javascript" src = "../js/view2/c.js"></script>
</slot>Note
- For css build blocks, the css reference style should be like "\", or else the associated file would not be built in.
Style2 Options
fileType- Target file type. Currently onlycssandjsare supported.outputLocation- Where the concated file content should output.Supported enum values arefile(which requires optionoutputFilePath) andinline. Valueinlinewill output the concated content inside the html file.Currently no more actions such as uglify or minimization is supported. You may specifyoutputLocationtofileand then use plugingulp-resolve-importto import after uglifying or minimizing the content.Note that when building css, asset references in the source css file will be automatically adjusted to the output location.outputFilePath- Which file to create or override to output the concated reference content. Relative (to the html file) path is supported.
License
MIT
1.0.19
10 months ago
1.0.18
10 months ago
1.0.17
6 years ago
1.0.16
6 years ago
1.0.15
6 years ago
1.0.14
6 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
8 years ago
1.0.9
8 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago