mirror of
https://github.com/vitejs/vite.git
synced 2024-11-22 07:09:05 +00:00
feat: add lerna workspace support to searchForWorkspaceRoot
(#6270)
This commit is contained in:
parent
7329b24e03
commit
0e164f80ee
@ -592,6 +592,7 @@ createServer()
|
||||
|
||||
- contains `workspaces` field in `package.json`
|
||||
- contains one of the following file
|
||||
- `lerna.json`
|
||||
- `pnpm-workspace.yaml`
|
||||
|
||||
Accepts a path to specify the custom workspace root. Could be a absolute path or a path relative to [project root](/guide/#index-html-and-project-root). For example:
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"private": true
|
||||
}
|
@ -2,6 +2,13 @@ import { searchForWorkspaceRoot } from '../searchRoot'
|
||||
import { resolve } from 'path'
|
||||
|
||||
describe('searchForWorkspaceRoot', () => {
|
||||
test('lerna', () => {
|
||||
const resolved = searchForWorkspaceRoot(
|
||||
resolve(__dirname, 'fixtures/lerna/nested')
|
||||
)
|
||||
expect(resolved).toBe(resolve(__dirname, 'fixtures/lerna'))
|
||||
})
|
||||
|
||||
test('pnpm', () => {
|
||||
const resolved = searchForWorkspaceRoot(
|
||||
resolve(__dirname, 'fixtures/pnpm/nested')
|
||||
|
@ -8,14 +8,17 @@ const ROOT_FILES = [
|
||||
// '.git',
|
||||
|
||||
// https://pnpm.js.org/workspaces/
|
||||
'pnpm-workspace.yaml'
|
||||
'pnpm-workspace.yaml',
|
||||
|
||||
// https://rushjs.io/pages/advanced/config_files/
|
||||
// 'rush.json',
|
||||
|
||||
// https://nx.dev/latest/react/getting-started/nx-setup
|
||||
// 'workspace.json',
|
||||
// 'nx.json'
|
||||
// 'nx.json',
|
||||
|
||||
// https://github.com/lerna/lerna#lernajson
|
||||
'lerna.json'
|
||||
]
|
||||
|
||||
// npm: https://docs.npmjs.com/cli/v7/using-npm/workspaces#installing-workspaces
|
||||
|
Loading…
Reference in New Issue
Block a user