gulp或者其他工具开发静态页面时如何包含常用组件

How can I include common components when I develop static pages by gulp or other tools

如果我正在开发静态页面,只有 html 个文件,这些文件可能包含通用组件,例如页眉或页脚...我可以将这些组件移动到一个单独的文件中,并在页面时包含此文件吗需要这个组件吗?如果我使用gulp的live reload,我该如何实现?就像服务器上的PHP:

<?php include xxx ?>

您可以使用 ejs 创建模板并使用 gulp 生成 html 文件。

同时支持lesscss编译

Starting with templates with ejs and gulp