diff --git a/babel.config.cjs b/babel.config.cjs index f7ff0eee..1a472c42 100644 --- a/babel.config.cjs +++ b/babel.config.cjs @@ -8,7 +8,12 @@ module.exports = { }, }, ], - "@babel/preset-react", + [ + "@babel/preset-react", + { + runtime: "automatic", + }, + ], "@babel/preset-typescript", ], plugins: ["babel-plugin-transform-vite-meta-env"], diff --git a/package.json b/package.json index c98dbe5a..39f930af 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,8 @@ "/node_modules/(?!internmap)+$" ], "moduleNameMapper": { - "\\.(css|less|svg)+$": "identity-obj-proxy", + "\\.css$": "identity-obj-proxy", + "\\.svg$": "/test/mocks/svgr.ts", "^\\./IndexedDBWorker\\?worker$": "/test/mocks/workerMock.ts", "^\\./olm$": "/test/mocks/olmMock.ts" }, diff --git a/test/mocks/svgr.ts b/test/mocks/svgr.ts new file mode 100644 index 00000000..18490609 --- /dev/null +++ b/test/mocks/svgr.ts @@ -0,0 +1,3 @@ +// Mock file for SVG imports +export default "SvgrURL"; +export const ReactComponent = "div";