如何从Rails应用程序中完全删除Yarn?

问题描述:

我正在使用 jQuery 和其他一些库来构建Rails 5.1.x Rails应用程序.Rails坚持要使用Yarn,这在开发机器上很好用,但我不能在生产中使用.

I'm building a Rails 5.1.x rails app with jQuery and a few other libraries. Rails is insisting on having Yarn on, which is fine on development machine but I cannot have it on production.

有没有一种方法可以使Rails在默认情况下不使用Yarn?删除 yarn.lock node_modules 及其附带的所有其他内容.

Is there a way to not have rails use Yarn by default? Remove yarn.lock and node_modules and everything else that comes with it.

创建Rails项目时,您可以添加-skip-yarn ,因为 rails新的app_path --skip-纱线.

When you create a rails project, you can add --skip-yarn as rails new app_path --skip-yarn.