-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bundling): add createNodesV2 for rollup plugin (#28090)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> There is no implementation for `createNodesV2`. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> There should be an implementation for `createNodesV2`. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
- Loading branch information
1 parent
7ba7f3e
commit 38448da
Showing
4 changed files
with
216 additions
and
106 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 +1,5 @@ | ||
export { createNodes, RollupPluginOptions } from './src/plugins/plugin'; | ||
export { | ||
createNodes, | ||
createNodesV2, | ||
RollupPluginOptions, | ||
} from './src/plugins/plugin'; |
142 changes: 91 additions & 51 deletions
142
packages/rollup/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,70 +1,110 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`@nx/rollup/plugin non-root project should create nodes 1`] = ` | ||
{ | ||
"projects": { | ||
"mylib": { | ||
"root": "mylib", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "rollup -c rollup.config.js", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"rollup", | ||
[ | ||
[ | ||
"mylib/rollup.config.js", | ||
{ | ||
"projects": { | ||
"mylib": { | ||
"root": "mylib", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "rollup -c rollup.config.js", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"rollup", | ||
], | ||
}, | ||
], | ||
"metadata": { | ||
"description": "Run Rollup", | ||
"help": { | ||
"command": "npx rollup --help", | ||
"example": { | ||
"options": { | ||
"sourcemap": true, | ||
"watch": true, | ||
}, | ||
}, | ||
}, | ||
"technologies": [ | ||
"rollup", | ||
], | ||
}, | ||
"options": { | ||
"cwd": "mylib", | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/mylib/build", | ||
"{workspaceRoot}/mylib/dist", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": "mylib", | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/mylib/build", | ||
"{workspaceRoot}/mylib/dist", | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; | ||
|
||
exports[`@nx/rollup/plugin root project should create nodes 1`] = ` | ||
{ | ||
"projects": { | ||
".": { | ||
"root": ".", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "rollup -c rollup.config.js", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"rollup", | ||
[ | ||
[ | ||
"rollup.config.js", | ||
{ | ||
"projects": { | ||
".": { | ||
"root": ".", | ||
"targets": { | ||
"build": { | ||
"cache": true, | ||
"command": "rollup -c rollup.config.js", | ||
"dependsOn": [ | ||
"^build", | ||
], | ||
"inputs": [ | ||
"production", | ||
"^production", | ||
{ | ||
"externalDependencies": [ | ||
"rollup", | ||
], | ||
}, | ||
], | ||
"metadata": { | ||
"description": "Run Rollup", | ||
"help": { | ||
"command": "npx rollup --help", | ||
"example": { | ||
"options": { | ||
"sourcemap": true, | ||
"watch": true, | ||
}, | ||
}, | ||
}, | ||
"technologies": [ | ||
"rollup", | ||
], | ||
}, | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/dist", | ||
], | ||
}, | ||
], | ||
"options": { | ||
"cwd": ".", | ||
}, | ||
"outputs": [ | ||
"{workspaceRoot}/dist", | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
], | ||
] | ||
`; |
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.