diff --git a/bundlewatch.config.json b/bundlewatch.config.json index cf25222a5..68645d021 100644 --- a/bundlewatch.config.json +++ b/bundlewatch.config.json @@ -2,7 +2,7 @@ "files": [ { "path": "dist/mirador.min.js", - "maxSize": "700 KB" + "maxSize": "710 kB" } ] } diff --git a/eslint.config.js b/eslint.config.js index c155a8610..20617cc1b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -75,7 +75,7 @@ export default [ 'import/no-duplicates': 'error', 'import/no-extraneous-dependencies': 'off', 'import/no-mutable-exports': 'error', - 'import/no-unresolved': [2, { ignore: ['test-utils', '@vitejs/plugin-react'] }], + 'import/no-unresolved': [2, { ignore: ['test-utils', '@vitejs/plugin-react', 'vite'] }], 'import/prefer-default-export': 'off', 'max-depth': ['warn', 4], 'max-params': ['warn', 5], diff --git a/netlify.toml b/netlify.toml index bf2f5eb53..7b632a5f6 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,10 +5,10 @@ publish = "dist/" [context.main.environment] - NODE_VERSION = "20.18.1" + NODE_VERSION = "22.12.0" [context.deploy-preview.environment] - NODE_VERSION = "20.18.1" + NODE_VERSION = "22.12.0" [[redirects]] from = "/" @@ -18,4 +18,4 @@ [[redirects]] from = "/:page" to = "/demo/:page" - status = 200 \ No newline at end of file + status = 200 diff --git a/package.json b/package.json index 41b99d9e9..82770d7cf 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@testing-library/jest-dom": "^6.1.5", "@testing-library/react": "^16.3.2", "@testing-library/user-event": "^14.4.3", - "@vitejs/plugin-react": "^5.2.0", + "@vitejs/plugin-react": "^6.0.1", "@vitest/coverage-v8": "^4.1.2", "@vitest/ui": "^4.1.2", "bundlewatch": "^0.4.0", @@ -112,7 +112,7 @@ "react-i18next": "^13.0.0 || ^14.0.0 || ^15.0.0", "redux-mock-store": "^1.5.1", "redux-saga-test-plan": "^4.0.0-rc.3", - "vite": "^7.3.1", + "vite": "8.0.10", "vitest": "^4.1.2", "vitest-fetch-mock": "^0.4.2" }, diff --git a/vite-umd.config.js b/vite-umd.config.js index 54a4c0814..8c9bd6ad5 100644 --- a/vite-umd.config.js +++ b/vite-umd.config.js @@ -1,6 +1,5 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; -import fs from 'fs/promises'; /** * Vite configuration @@ -14,7 +13,7 @@ export default defineConfig({ formats: ['umd'], name: 'Mirador', }, - rollupOptions: { + rolldownOptions: { external: [ '__tests__/*', '__mocks__/*', diff --git a/vite.config.js b/vite.config.js index ce4fd98a2..a5ec667ea 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,7 +13,7 @@ export default defineConfig({ ...( process.env.NETLIFY ? { build: { - rollupOptions: { + rolldownOptions: { external: ['__tests__/*', '__mocks__/*'], input: Object.fromEntries( globSync('./demo/*.html').map((file) => [ @@ -39,11 +39,11 @@ export default defineConfig({ formats: ['es'], name: 'Mirador', }, - rollupOptions: { - external: (id, parentId) => { + rolldownOptions: { + external: (id) => { const peers = Object.keys(packageJson.peerDependencies); return peers.indexOf(id) > -1 - || peers.find((peer) => id.startsWith(`${peer}/`)) + || peers.some((peer) => id.startsWith(`${peer}/`)) || id.startsWith('__tests__/') || id.startsWith('__mocks__/'); }, diff --git a/vitest.config.ts b/vitest.config.ts index d8959d6e1..4f6cf76ae 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,29 +1,17 @@ -/// -import { defineConfig } from 'vite'; +import { defineConfig } from 'vitest/config'; import react from '@vitejs/plugin-react'; import { fileURLToPath } from 'url'; -import fs from 'fs/promises'; export default defineConfig({ - esbuild: { + oxc: { exclude: [], include: /(src|__tests__)\/.*\.jsx?$/, - loader: 'jsx', }, optimizeDeps: { - esbuildOptions: { - plugins: [ - { - name: 'load-js-files-as-jsx', - /** */ - setup(build) { - build.onLoad({ filter: /(src|__tests__)\/.*\.js$/ }, async (args) => ({ - contents: await fs.readFile(args.path, 'utf8'), - loader: 'jsx', - })); - }, - }, - ], + rolldownOptions: { + moduleTypes: { + '.js': 'jsx', + }, }, }, plugins: [react()],