-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vite): add CreateNodesV2 function
- Loading branch information
Showing
8 changed files
with
205 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export { | ||
createNodes, | ||
createNodesV2, | ||
VitePluginOptions, | ||
createDependencies, | ||
} from './src/plugins/plugin'; |
56 changes: 31 additions & 25 deletions
56
packages/vite/src/plugins/__snapshots__/plugin-vitest.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,41 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`@nx/vite/plugin root project should create nodes 1`] = ` | ||
{ | ||
"projects": { | ||
".": { | ||
"root": ".", | ||
"targets": { | ||
"test": { | ||
"cache": true, | ||
"command": "vitest", | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vitest", | ||
[ | ||
[ | ||
"vitest.config.ts", | ||
{ | ||
"projects": { | ||
".": { | ||
"metadata": {}, | ||
"root": ".", | ||
"targets": { | ||
"test": { | ||
"cache": true, | ||
"command": "vitest", | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vitest", | ||
], | ||
}, | ||
{ | ||
"env": "CI", | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/coverage", | ||
], | ||
}, | ||
{ | ||
"env": "CI", | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/coverage", | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; |
56 changes: 31 additions & 25 deletions
56
packages/vite/src/plugins/__snapshots__/plugin-with-test.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,41 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`@nx/vite/plugin with test node root project should create nodes - with test too 1`] = ` | ||
{ | ||
"projects": { | ||
".": { | ||
"root": ".", | ||
"targets": { | ||
"test": { | ||
"cache": true, | ||
"command": "vitest", | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vitest", | ||
[ | ||
[ | ||
"vite.config.ts", | ||
{ | ||
"projects": { | ||
".": { | ||
"metadata": {}, | ||
"root": ".", | ||
"targets": { | ||
"test": { | ||
"cache": true, | ||
"command": "vitest", | ||
"inputs": [ | ||
"default", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vitest", | ||
], | ||
}, | ||
{ | ||
"env": "CI", | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/coverage", | ||
], | ||
}, | ||
{ | ||
"env": "CI", | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/coverage", | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; |
190 changes: 100 additions & 90 deletions
190
packages/vite/src/plugins/__snapshots__/plugin.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,119 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`@nx/vite/plugin not root project should create nodes 1`] = ` | ||
{ | ||
"projects": { | ||
"my-app": { | ||
"metadata": {}, | ||
"root": "my-app", | ||
"targets": { | ||
"build-something": { | ||
"cache": true, | ||
"command": "vite build", | ||
"dependsOn": [ | ||
"^build-something", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vite", | ||
[ | ||
[ | ||
"my-app/vite.config.ts", | ||
{ | ||
"projects": { | ||
"my-app": { | ||
"metadata": {}, | ||
"root": "my-app", | ||
"targets": { | ||
"build-something": { | ||
"cache": true, | ||
"command": "vite build", | ||
"dependsOn": [ | ||
"^build-something", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vite", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/dist/{projectRoot}", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/dist/{projectRoot}", | ||
], | ||
}, | ||
"my-serve": { | ||
"command": "vite serve", | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
}, | ||
"preview-site": { | ||
"command": "vite preview", | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
}, | ||
"serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "build-something", | ||
"spa": true, | ||
"my-serve": { | ||
"command": "vite serve", | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
}, | ||
"preview-site": { | ||
"command": "vite preview", | ||
"options": { | ||
"cwd": "my-app", | ||
}, | ||
}, | ||
"serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "build-something", | ||
"spa": true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; | ||
|
||
exports[`@nx/vite/plugin root project should create nodes 1`] = ` | ||
{ | ||
"projects": { | ||
".": { | ||
"metadata": {}, | ||
"root": ".", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "vite build", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vite", | ||
[ | ||
[ | ||
"vite.config.ts", | ||
{ | ||
"projects": { | ||
".": { | ||
"metadata": {}, | ||
"root": ".", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "vite build", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"vite", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/dist", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{projectRoot}/dist", | ||
], | ||
}, | ||
"preview": { | ||
"command": "vite preview", | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
}, | ||
"serve": { | ||
"command": "vite serve", | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
}, | ||
"serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "build", | ||
"spa": true, | ||
"preview": { | ||
"command": "vite preview", | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
}, | ||
"serve": { | ||
"command": "vite serve", | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
}, | ||
"serve-static": { | ||
"executor": "@nx/web:file-server", | ||
"options": { | ||
"buildTarget": "build", | ||
"spa": true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.