alsotang / node-lessons

:closed_book:《Node.js 包教不包会》 by alsotang
16.54k stars 4.7k forks source link

Lesson6 除了用Makefile还可以用npm scripts #65

Open rdmclin2 opened 8 years ago

rdmclin2 commented 8 years ago

看这一课发现了node_modules下的.bin文件夹, 然后搜了下node_modules .bin看到No need for globals - npm scripts add .bin to PATH, 然后搜了下npm scripts发现了segment fault下的一篇文章用npm-run自动化任务写的很不错,个人觉得简单的任务完全可以用npm-scripts替代,要比Makefile简单一些:)

XGHeaven commented 8 years ago

这个我觉得都是可以的。有的人可能习惯makefile,他就喜欢用。可能后来的一些人不知道makefile,于是就只会用npm script了。 当然我也觉得npm script在某种程度上比较方便和好,我现在也是在用这这个的。 这东西全看你个人喜好。

alsotang commented 8 years ago

makefile 里面可以稍微带一点逻辑,npm script 完全是纯字符串的。 而且我本人是用 makefile 顺手一点。 npm script 这种纯字符串的命令行,怎么接收参数呢? 一开始写 npm script,当程序复杂了之后,重新开始用 grunt 或者 makefile,这时是分两套走,还是全部合并到 grunt 或 makefile?

在 2015年9月29日 下午10:29,Xu Tianyang notifications@github.com写道:

这个我觉得都是可以的。有的人可能习惯makefile,他就喜欢用。可能后来的一些人不知道makefile,于是就只会用npm script了。 当然我也觉得npm script在某种程度上比较方便和好,我现在也是在用这这个的。 这东西全看你个人喜好。

— Reply to this email directly or view it on GitHub https://github.com/alsotang/node-lessons/issues/65#issuecomment-144077390 .