Skip to content

Commit

Permalink
fix(nx): skip rollup overrides (#260)
Browse files Browse the repository at this point in the history
* fix(nx): skip rollup overrides

* refactor: merge if block

* fix: remove extra }

* chore: format

* chore: space before comment

* fix: improve boolean logic for overrides.rollup

---------

Co-authored-by: Dominik G <[email protected]>
  • Loading branch information
sapphi-red and dominikg authored Nov 3, 2023
1 parent d203d1b commit c7a8568
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/nx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ export async function test(options: RunOptions) {
{ script: 'test', args: ['vite', '--skip-nx-cache'] },
{ script: 'e2e', args: ['e2e-vite', '--skip-nx-cache'] },
],
overrides: {
rollup: false,
},
})
}
6 changes: 5 additions & 1 deletion utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ export async function runInRepo(options: RunOptions & RepoOptions) {
] ||= `${options.vitePath}/packages/plugin-legacy`

const vitePackageInfo = await getVitePackageInfo(options.vitePath)
if (vitePackageInfo.dependencies.rollup?.version && !overrides.rollup) {
// skip if `overrides.rollup` is `false`
if (
vitePackageInfo.dependencies.rollup?.version &&
overrides.rollup !== false
) {
overrides.rollup = vitePackageInfo.dependencies.rollup.version
}

Expand Down

0 comments on commit c7a8568

Please sign in to comment.