我克隆了一个nodejs项目,该项目包含一个Makefile
SRC = $(wildcard lib/**/*.js)
CSS = $(wildcard lib/**/*.css)
HTML = $(wildcard lib/**/*.html)
COMPONENTJSON = $(wildcard lib/*/component.json)
TEMPLATES = $(HTML:.html=.js)
build: components $(SRC) $(CSS) $(TEMPLATES)
@echo building
@component build
components: component.json $(COMPONENTJSON)
@echo installing
@component install
%.js: %.html
@echo converting
@component convert $<
minify:
@component build --use component-minify
clean:
@echo cleaning
rm -fr build components $(TEMPLATES)
.PHONY: clean minify
我之前不知道 make 可以用来构建 javascript,当我运行 make
时,我收到错误
installing
make: component: Command not found
make: *** [components] Error 127
我的问题是,
1.它是使用unix系统提供的相同的默认make,还是使用某种其他 Node 库?
2.如果是相同的系统默认值,为什么我会收到错误?
link to the example project
最佳答案
该文件使用与任何 UNIX/Linux 系统中相同的 make
。
该错误是由于 component
包不可用造成的。我使用以下方法安装了组件
:
npm install -g component
关于javascript - 使用 Makefile 构建 javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31866545/