这似乎是一个非常简单的问题,但花了最后 3 个小时研究它,发现如果不使用 watchify,每次保存新文件都会很慢。
这是我的目录树:
gulpfile.js
package.json
www/
default.htm
<script src="toBundleJsHere/file123.js"></script>
toBundletheseJs/
componentX/
file1.js
componentY/
file2.js
componentZ/
file3.js
toPutBundledJsHere/
file123.js
要求。在文件夹中每次创建或保存文件时,toBundleTheseJs/
我希望将此文件重新捆绑到toBundleJsHere/
我需要在我的package.json
文件中包含什么?
我需要写入我的 gulp 文件的最低要求是多少?
这应该尽可能快,所以认为我应该使用 browserify 和 watchify。我想了解最少的步骤,所以在这一点上使用像 jspm 这样的包管理器是多余的。
谢谢