Skip to content

Commit

Permalink
fix: transpile esnext to node18 to support newest JS and TS features (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Jul 4, 2024
1 parent 057b4f3 commit 8f65ae9
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 492 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-and-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:

steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4

- name: Set node version to ${{ inputs.node-version }}
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4

- name: Install node
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4

- name: Set node version to 20
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"simple-git-hooks": "^2.11.1",
"tsx": "^4.16.0",
"typescript": "^5.5.2",
"vite": "^5.2.6",
"vite": "^5.3.3",
"vitest": "workspace:*",
"zx": "^8.1.3"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ export async function VitestPlugin(
viteConfig.esbuild === false
? false
: {
// Lowest target Vitest supports is Node18
target: viteConfig.esbuild?.target || 'node18',
sourcemap: 'external',

// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
Expand Down
15 changes: 9 additions & 6 deletions packages/vitest/src/node/plugins/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,15 @@ export function WorkspaceVitestPlugin(
alias: testConfig.alias,
conditions: ['node'],
},
esbuild: {
sourcemap: 'external',

// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
esbuild: viteConfig.esbuild === false
? false
: {
// Lowest target Vitest supports is Node18
target: viteConfig.esbuild?.target || 'node18',
sourcemap: 'external',
// Enables using ignore hint for coverage providers with @preserve keyword
legalComments: 'inline',
},
server: {
// disable watch mode in workspaces,
// because it is handled by the top-level watcher
Expand Down
Loading

0 comments on commit 8f65ae9

Please sign in to comment.