如何避免运行“npm run build”对应用程序进行非常小的更改?
我必须运行 npm run build 来对应用程序进行任何小的更改,即使是文本框。然而,当应用程序规模变得越来越大时,它会变得烦人且低效。有什么方法可以对唯一改变的部分进行构建吗?
我的 package.json 文件包括:
"scripts": {
"build": "react-scripts build"
}
I have to run npm run build
for any small changes on the app, even for a text box. However, it gets annoying and inefficient when the application size gets bigger and bigger. Is there any way of taking a build for the only part that is changed?
My package.json file includes:
"scripts": {
"build": "react-scripts build"
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
npm run build
运行脚本“build”并创建一个运行应用程序的脚本(例如 server.js)。因此,为了查看您所做的更改并确保其对应用程序的影响,您需要运行此命令。您在包含该特定组件的页面中看到错误并不总是显而易见的。有时,由于任何其他组件或任何第三方库,其他地方可能会发生冲突。因此,同时检查和测试您的更改始终是最佳实践。因此,在我看来,即使是像 Facebook 这样的公司也会重新运行此命令以进行小的更改。
npm run build
runs the script "build" and creates a script which runs your application (say server.js). So in order to view the changes made by you and ensure its effect on the application, you need to run this command.It is not always obvious that you would see errors in the page containing that particular component. Sometimes, due to any other component or any third-party libraries there can be conflict somewhere else. So, it is always the best practice to check and test your changes simultaneously. So, in my opinion even companies like Facebook would re run this command for small changes as well.