vue.js - Vue CLI 和 Yarn 工作区
问题描述
是否可以在多包 Lerna 和 Yarn 工作区存储库中使用 Vue CLI(尤其是其插件)?我希望能够安装 Jest 插件并让它可用于我的所有软件包。
例如,这是我的根package.json
:
{
...
"private": true,
"workspaces": ["packages/*"],
"scripts": {
...
"test": "yarn workspaces run test"
},
...
"devDependencies": {
...
"@vue/cli-plugin-babel": "^4.3.1",
"@vue/cli-plugin-eslint": "^4.3.1",
"@vue/cli-plugin-unit-jest": "^4.3.1",
"@vue/cli-service": "^4.3.1",
... other dependencies installed by Vue CLI
}
}
然后包装package.json
:
{
...,
"scripts": {
"test": "vue-cli-service test:unit",
...
},
...
}
如果我yarn test
在项目的根目录中运行,则会收到以下错误:
$ yarn workspaces run test
> my-package
$ vue-cli-service test:unit
ERROR command "test:unit" does not exist.
error Command failed with exit code 1.
有什么我想念的吗?或者这只是 Vue CLI 不支持?
解决方案
推荐阅读
- r - glm函数中的循环数据框列
- docker - 如何通过 app.json 在 Heroku 上运行 Docker Hub 容器?
- javascript - 你如何让一个函数改变在javascript中放入的变量?
- javascript - 如何将响应中的页码设置为数字,而不是 PaginationJS 中的数组
- servicestack - 列表与细节 DTO
- python - 1. 总结 pandas 数据框中的特定行 2. 创建包含整体价值的新数据框
- mysql - Azure Mysql 保持高 CPU 使用率,我无法调低它
- crystal-reports - 是否可以在 Crystal Reports 中创建列表或其他可变对象?
- android - Firebase 推送通知 - 如何更改活动目的地?
- vmware-clarity - 如何使用清晰度自定义 clrdgfilter 的位置?