Skip to content

Commit f1f166c

Browse files
committed
Vite 8 upgrade: use rolldownOptions and oxc in config
1 parent b385321 commit f1f166c

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

vite.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
...(
1414
process.env.NETLIFY ? {
1515
build: {
16-
rollupOptions: {
16+
rolldownOptions: {
1717
external: ['__tests__/*', '__mocks__/*'],
1818
input: Object.fromEntries(
1919
globSync('./demo/*.html').map((file) => [
@@ -39,7 +39,7 @@ export default defineConfig({
3939
formats: ['es'],
4040
name: 'Mirador',
4141
},
42-
rollupOptions: {
42+
rolldownOptions: {
4343
external: (id, parentId) => {
4444
const peers = Object.keys(packageJson.peerDependencies);
4545
return peers.indexOf(id) > -1

vitest.config.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
11
/// <reference types="vitest" />
2-
import { defineConfig } from 'vite';
2+
import { defineConfig } from 'vitest/config';
33
import react from '@vitejs/plugin-react';
44
import { fileURLToPath } from 'url';
5-
import fs from 'fs/promises';
6-
75
export default defineConfig({
8-
esbuild: {
6+
oxc: {
97
exclude: [],
108
include: /(src|__tests__)\/.*\.jsx?$/,
11-
loader: 'jsx',
12-
},
13-
optimizeDeps: {
14-
esbuildOptions: {
15-
plugins: [
16-
{
17-
name: 'load-js-files-as-jsx',
18-
/** */
19-
setup(build) {
20-
build.onLoad({ filter: /(src|__tests__)\/.*\.js$/ }, async (args) => ({
21-
contents: await fs.readFile(args.path, 'utf8'),
22-
loader: 'jsx',
23-
}));
24-
},
25-
},
26-
],
27-
},
289
},
2910
plugins: [react()],
3011
resolve: {

0 commit comments

Comments
 (0)