Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "/"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.3",
"vitest": "^4.1.2",
"vitest-fetch-mock": "^0.4.2"
},
Expand Down
8 changes: 5 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import { fileURLToPath } from 'url';
import { globSync } from 'glob';
import * as packageJson from './package.json';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

/**
* Vite configuration
*/
export default defineConfig({
...(
process.env.NETLIFY ? {
build: {
rollupOptions: {
rolldownOptions: {
external: ['__tests__/*', '__mocks__/*'],
input: Object.fromEntries(
globSync('./demo/*.html').map((file) => [
Expand All @@ -39,11 +41,11 @@ export default defineConfig({
formats: ['es'],
name: 'Mirador',
},
rollupOptions: {
rolldownOptions: {
external: (id, parentId) => {
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__/');
},
Expand Down
23 changes: 2 additions & 21 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
/// <reference types="vitest" />
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',
}));
},
},
],
},
},
plugins: [react()],
resolve: {
Expand Down
Loading