如何为 React 应用程序创建 Makefile.txt?

How to create a Makefile.txt for React app?

我正在为一个工作面试做一个带回家的项目,我的任务是创建一个带有前端和后端测试的 React 应用程序。他们指示我他们将使用“Makefile 中指定的 make 目标(他们已经提供了。见下文)”来执行我的代码。我已经完成了应用程序和测试用例,但是我在最后一步很迷茫。

我知道 makefile 本质上是用来执行脚本的,但不确定如何告诉它设置应用程序环境。

这是 Makefile.txt

的副本
.PHONY: $(MAKECMDGOALS)

# `make setup` will be used after cloning or downloading to fulfill
# dependencies, and setup the the project in an initial state.
# This is where you might download rubygems, node_modules, packages,
# compile code, build container images, initialize a database,
# anything else that needs to happen before your server is started
# for the first time
setup:

# `make server` will be used after `make setup` in order to start
# an http server process that listens on any unreserved port
#   of your choice (e.g. 8080). 
server:

# `make test` will be used after `make setup` in order to run
# your test suite.
test:

感谢任何帮助、理解或澄清。

我认为这是关于您在 package.json 文件中的脚本 - link,他们可能想要像 make setup 脚本和所有其他 运行 特定功能,例如,如果他们在终端中键入 make test,它将开始 运行ning 测试,例如 npm test