Vue.js Vue CLI和纱线工作区
是否可以在多包Lerna和Thread工作区存储库中使用Vue CLI,特别是其插件?我希望能够安装Jest插件,并将其提供给我的所有软件包 例如,下面是我的rootVue.js Vue CLI和纱线工作区,vue.js,yarnpkg,vue-cli,lerna,yarn-workspaces,Vue.js,Yarnpkg,Vue Cli,Lerna,Yarn Workspaces,是否可以在多包Lerna和Thread工作区存储库中使用Vue CLI,特别是其插件?我希望能够安装Jest插件,并将其提供给我的所有软件包 例如,下面是我的rootpackage.json: { ... "private": true, "workspaces": ["packages/*"], "scripts": { ... "test": "yarn workspaces run test" }, ... "devDependencies":
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
}
}
{
...,
"scripts": {
"test": "vue-cli-service test:unit",
...
},
...
}
然后是包的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
}
}
{
...,
"scripts": {
"test": "vue-cli-service test:unit",
...
},
...
}
如果我在项目的根目录中运行纱线测试
,我会得到以下错误:
$ 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不支持