Skip to content

Commit e0a0765

Browse files
authored
Add rolldown-vite 7.2.3+ support (#139)
1 parent 282420a commit e0a0765

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- run: pnpm playwright install --with-deps
3333
- name: update overrides to use rolldown-vite and re-install
3434
run: |
35-
jq '.pnpm.overrides.vite = "npm:rolldown-vite@^7.0.1"' package.json > package.tmp.json
35+
jq '.pnpm.overrides.vite = "npm:rolldown-vite@^7.2.5"' package.json > package.tmp.json
3636
mv package.tmp.json package.json
3737
pnpm i --no-frozen-lockfile
3838
- run: pnpm -r test:e2e

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export const nodePolyfills = (options: PolyfillOptions = {}): Plugin => {
234234
},
235235
...Object.keys(shimsToInject).length > 0
236236
? isRolldownVite
237-
? { inject: shimsToInject }
237+
? { transform: { inject: shimsToInject } }
238238
: { plugins: [inject(shimsToInject)] }
239239
: {},
240240
},
@@ -249,14 +249,16 @@ export const nodePolyfills = (options: PolyfillOptions = {}): Plugin => {
249249
],
250250
...isRolldownVite
251251
? {
252-
rollupOptions: {
253-
define: defines,
252+
rolldownOptions: {
254253
resolve: {
255254
// https://github.com/niksy/node-stdlib-browser/blob/3e7cd7f3d115ac5c4593b550e7d8c4a82a0d4ac4/README.md?plain=1#L150
256255
alias: {
257256
...polyfills,
258257
},
259258
},
259+
transform: {
260+
define: defines,
261+
},
260262
plugins: [
261263
{
262264
name: 'vite-plugin-node-polyfills:optimizer',

0 commit comments

Comments
 (0)