We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli 的模板 package.json 里边的 script 应该是 crn-cli xxx 吧? 另外 启动 bundle server,路径在 ./project_name/__tmp 目录下,应该在 ./project_name ?
./project_name/__tmp
./project_name
The text was updated successfully, but these errors were encountered:
fix in 3e76012
通过crn-cli start启动服务主要做两件事: 1、在当前工程目录创建一个__tmp文件夹,写入脚本文件launchPackager.command和packager.sh 2、执行launchPackager.command启动服务。 所以,启动bundle server的路径在./project_name/__tmp目录下。
crn-cli start
__tmp
launchPackager.command
packager.sh
Sorry, something went wrong.
@blackwuxin 但是 index.js 入口文件是在 ./project_name 下
你说的没错,项目入口index.js是在./project_name目录下。
index.js
比较合理做法是从__tmp目录切换到./project_name目录下,再启动服务。
为什么现有crn-cli start启动服务的时候也可以正常访问呢?到@react-native-community/cli@1.5.0才传入了projectRoot参数到metro中#259。而crn-cli init 创建模板工程时候,指定依赖版本@react-native-community/cli@1.4.5,在start的是也检查了@react-native-community/cli版本,对应版本号大于等于1.5.0多传入了--projectRoot进行跟目录设置。
@react-native-community/cli@1.5.0
projectRoot
metro
crn-cli init
@react-native-community/cli@1.4.5
start
@react-native-community/cli
1.5.0
--projectRoot
我们会在下个版本修改下启动服务,先切换到工作目录在执行启动服务。感谢反馈。
现在手动修改服务启动路径,会被cli覆盖掉无法生效,但是不修改的话一直报错,因为入口文件在./project_name目录下,crn却去__tmp目录中寻找,导致找不到入口文件而报错。 要怎么解决这个问题呢?
No branches or pull requests
cli 的模板 package.json 里边的 script 应该是 crn-cli xxx 吧?
另外 启动 bundle server,路径在
./project_name/__tmp
目录下,应该在./project_name
?The text was updated successfully, but these errors were encountered: