浏览代码

Небольшие доработки

Book Pauk 5 年之前
父节点
当前提交
b32213cb7b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      build/includer.js

+ 4 - 0
build/includer.js

@@ -1,6 +1,9 @@
 const path = require('path');
 const fs = require('fs');
 
+//пример в коде:
+//  @@include('./test/testFile.inc');
+
 exports.default = function includer(source) {
     const lines = source.split('\n');
 
@@ -12,6 +15,7 @@ exports.default = function includer(source) {
             const includedFile = path.resolve(path.dirname(this.resourcePath), m[1]);
             const fileContent = fs.readFileSync(includedFile, 'utf8');
             result.push(fileContent);
+            this.addDependency(includedFile);
         } else {
             result.push(line);
         }