skiqt / includefile-loader

include all file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

includefile-loader

include .js .css .html ...

安装

Install

npm install --save-dev includefile-loader

注意事项 》不要相互嵌套《 否则有不好的结果

案例

|include
--|a.js
--|b.js
--|base.html
--|body.html
--|footer.html
--|header.html
--|style.css
|text.html

text.html

<include src="include/base.html">
  <include src="./include/header.html"></include>
  <include src="./include/body.html"></include>
  <include src="./include/footer.html">
    <include src="./include/header.html"></include>
  </include>
</include>

base.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <include src="style.css" />
  </head>
  <body>
      <!-- {{ include }} -->
  </body>
</html>

懒! 结果就不贴了

About

include all file


Languages

Language:JavaScript 85.6%Language:HTML 13.8%Language:CSS 0.6%