如何在执行之前实现属性预处理,就像在Grunt中完成一样?

时间:2016-05-05 07:31:59

标签: javascript node.js replace gruntjs constants

Grunt具有语法,用于在任务执行之前设置和更新配置属性。

例如,

config {
  dist: {
     dir: "dir1"
  },
  clean: {
      dirs: [
          '<dist.dir>'
      ]
  }
}

成为记忆......

config {
  dist: {
     dir: "dir1"
  },
  clean: {
      dirs: [
          "dir1"
      ]
  }
}

npm模块负责什么?请告诉我如何以更好的方式实现它?谢谢!

1 个答案:

答案 0 :(得分:1)

Grunt中的模板字符串来自Lo-Dash包。

参考文献: