用纱线设置 Backbone

setting up Backbone with yarn

我最近用 yarn 添加了各种库,如下所示:

yarn add jquery backbone underscore bootstrap

使用 bower 可以列出每个库所在的路径,我如何使用 yarn 做到这一点?

yarn list --paths 只给我库的名称和版本号。

问题是您正在尝试使用 yarn 以前 bower 工作的方式,但是 yarn list --paths 只会给您您所指出的依赖项和版本号。

我想你需要明白的是,你不是在使用bower_components,而是在使用node_modules。话虽如此,您的路径可能类似于 /node_modules/bootstrap/dist/css/bootstrap.css。打开你的 node_modules 文件夹,你就会明白我在说什么。